Skip to content

Commit 6620127

Browse files
committed
Fix unwanted redirect from search index to edit on login error
The search action saves searches including: @template=index|search The code strips: @template=index but not the error condition template. So when an non-logged in user uses a search with @template=index|search and fails to log in, their displayed page is the search edit page (template search) not the search display (template index). This change strips both forms when saving. I don't know if this needs to be generalized to strip additional templates. But it solves te orignal issue with search displays jumping to edit mode on login failure.
1 parent b754018 commit 6620127

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

roundup/cgi/actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ def getCurrentURL(self, req):
464464
different from 'index'
465465
"""
466466
template = self.getFromForm('template')
467-
if template and template != 'index':
467+
if template and template not in ['index', 'index|search']:
468468
return req.indexargs_url('', {'@template': template})[1:]
469469
return req.indexargs_url('', {})[1:]
470470

0 commit comments

Comments
 (0)