From 12c77d44b20aa13b7f5406d2799931fd402750e7 Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Fri, 7 Feb 2020 10:03:57 +0000
Subject: [PATCH] erp5_web_renderjs_ui: try simplifying web section retrieval

---
 .../portal_skins/erp5_web_renderjs_ui/WebPage_viewAsWeb.py  | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/WebPage_viewAsWeb.py b/bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/WebPage_viewAsWeb.py
index 2d1fb91eb6..424d267bee 100644
--- a/bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/WebPage_viewAsWeb.py
+++ b/bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/WebPage_viewAsWeb.py
@@ -10,11 +10,7 @@ response.setBase(None)
 response.setHeader("Access-Control-Allow-Origin", "*")
 
 web_page = context
-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
+web_section = context.getWebSectionValue()
 
 if REQUEST.getHeader('If-Modified-Since', '') == web_page.getModificationDate().rfc822():
   response.setStatus(304)
-- 
2.30.9