Commit 1845497e authored by Xiaowu Zhang's avatar Xiaowu Zhang

SelectionTool: Don't rely on view when redirect

Consider that view is the default is wrong, we should invoke call on the object, this change fix listboxes used on frontpage of a website.

See merge request !1115
parents 20437645 0f162102
Pipeline #9291 failed with stage
in 0 seconds
...@@ -223,7 +223,9 @@ class SelectionTool( BaseTool, SimpleItem ): ...@@ -223,7 +223,9 @@ class SelectionTool( BaseTool, SimpleItem ):
warnings.warn('DEPRECATED: _redirectToOriginalForm got called with a query_string. The variables must be passed in REQUEST.form.', warnings.warn('DEPRECATED: _redirectToOriginalForm got called with a query_string. The variables must be passed in REQUEST.form.',
DeprecationWarning) DeprecationWarning)
context = REQUEST['PARENTS'][0] context = REQUEST['PARENTS'][0]
form_id = dialog_id or REQUEST.get('dialog_id', None) or form_id or REQUEST.get('form_id', 'view') form_id = dialog_id or REQUEST.get('dialog_id', None) or form_id or REQUEST.get('form_id', None)
if form_id is None:
return context()
return getattr(context, form_id)() return getattr(context, form_id)()
security.declareProtected(ERP5Permissions.View, 'getSelectionNameList') security.declareProtected(ERP5Permissions.View, 'getSelectionNameList')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment