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