Commit 0b0d4012 authored by Yusei Tahara's avatar Yusei Tahara

erp5_core/Base_edit: Use make_query to encode URL parameters.

parent 2a57bc72
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
from the context update logic from the context update logic
""" """
from Products.Formulator.Errors import FormValidationError from Products.Formulator.Errors import FormValidationError
from ZTUtils import make_query
request=container.REQUEST request=container.REQUEST
portal = context.getPortalObject() portal = context.getPortalObject()
...@@ -258,25 +259,21 @@ if context.REQUEST.get('is_web_mode', False) and \ ...@@ -258,25 +259,21 @@ if context.REQUEST.get('is_web_mode', False) and \
not editable_mode: not editable_mode:
form_id = 'view' form_id = 'view'
if not selection_index: redirect_url_kw = dict(
redirect_url = '%s/%s?ignore_layout:int=%s&editable_mode:int=%s&portal_status_message=%s' % ( ignore_layout=ignore_layout,
editable_mode=editable_mode,
portal_status_message=message
)
if selection_index:
redirect_url_kw.update(
selection_index=selection_index,
selection_name=selection_name
)
redirect_url = '%s/%s?%s' % (
context.absolute_url(), context.absolute_url(),
form_id, form_id,
ignore_layout, make_query(**redirect_url_kw)
editable_mode, )
message)
else:
redirect_url = '%s/%s?selection_index=%s&selection_name=%s&ignore_layout:int=%s&editable_mode=%s&portal_status_message=%s' % (
context.absolute_url(),
form_id,
selection_index,
selection_name,
ignore_layout,
editable_mode,
message)
result = request['RESPONSE'].redirect(redirect_url) result = request['RESPONSE'].redirect(redirect_url)
......
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