Commit 7c63f17a authored by Sebastien Robin's avatar Sebastien Robin Committed by Eteri

erp5_web_renderjs_ui: the web_section is not always set in request, try to look at parent

Make sure we find section if we render https://my_site/my_section/foo.html. This is required
to take into account configuration of the web section, like specific content security policy.
parent 9bf9264f
...@@ -5,6 +5,10 @@ if response is None: ...@@ -5,6 +5,10 @@ if response is None:
web_page = context web_page = context
web_section = REQUEST.get("current_web_section") web_section = REQUEST.get("current_web_section")
if web_section is None:
parent_value = context.getParentValue()
if parent_value.getPortalType() == "Web Section":
web_section = parent_value
if REQUEST.getHeader('If-Modified-Since', '') == web_page.getModificationDate().rfc822(): if REQUEST.getHeader('If-Modified-Since', '') == web_page.getModificationDate().rfc822():
response.setStatus(304) response.setStatus(304)
......
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