Commit d9f83777 authored by Ivan Tyagov's avatar Ivan Tyagov

Handle the case when substitution happens on web page module context (i.e....

Handle the case when substitution happens on web page module context (i.e. reindex, or mass pre conversion) then fall back to ERP5 site as a Web Site.
parent 10445878
...@@ -59,11 +59,18 @@ ...@@ -59,11 +59,18 @@
# your own script instead.\n # your own script instead.\n
\n \n
website = context.getWebSiteValue()\n website = context.getWebSiteValue()\n
websection = context.getWebSectionValue()\n if website is None:\n
\n # handle the case when substitution happens on web page module context (i.e. reindex, or mass pre conversion)\n
return dict(website_url=website.absolute_url(),\n # then fall back to ERP5 site as a Web Site\n
websection_url=websection.absolute_url(),\n website = context.getPortalObject()\n
webpage_url=websection.getPermanentURL(context))\n return dict(website_url=website.absolute_url(),\n
websection_url=website.absolute_url(),\n
webpage_url=context.absolute_url())\n
else:\n
websection = context.getWebSectionValue()\n
return dict(website_url=website.absolute_url(),\n
websection_url=websection.absolute_url(),\n
webpage_url=websection.getPermanentURL(context))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
1074 1075
\ No newline at end of file \ No newline at end of file
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