Commit d76704f8 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web] No need to duplicate the REQUEST actual_url key

parent aa516c7e
...@@ -7,8 +7,6 @@ Proxy of StaticWebSection_getDocumentValue to allow redirection ...@@ -7,8 +7,6 @@ Proxy of StaticWebSection_getDocumentValue to allow redirection
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# name main_template # name main_template
context.REQUEST.other['actual_url'] = context.REQUEST['ACTUAL_URL']
# catch KeyError on source_path with urls "", "?", "/?", "...&" # catch KeyError on source_path with urls "", "?", "/?", "...&"
try: try:
context.REQUEST.other['source_path'] = name context.REQUEST.other['source_path'] = name
......
...@@ -26,7 +26,7 @@ if query_string: ...@@ -26,7 +26,7 @@ if query_string:
redirect_url = '?'.join([redirect_url, query_string]) redirect_url = '?'.join([redirect_url, query_string])
if redirect_url.find(INDEX) > -1 and not redirect_url.endswith(INDEX): if redirect_url.find(INDEX) > -1 and not redirect_url.endswith(INDEX):
redirect_url = redirect_url.replace(INDEX, '') redirect_url = redirect_url.replace(INDEX, '')
if redirect_url.find(INDEX) > -1 and REQUEST.other['actual_url'].find(INDEX) == -1: if redirect_url.find(INDEX) > -1 and REQUEST['ACTUAL_URL'].find(INDEX) == -1:
redirect_url = redirect_url.replace(INDEX, '') redirect_url = redirect_url.replace(INDEX, '')
return context.Base_redirect(redirect_url, status_code=status_code) return context.Base_redirect(redirect_url, status_code=status_code)
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