Commit 5ccd0bc2 authored by Ivan Tyagov's avatar Ivan Tyagov

When generating breadcumb list, not always parent object is accessible (for anonymous user).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20973 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 718ee920
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -135,8 +132,12 @@ while crumb is not None:\n ...@@ -135,8 +132,12 @@ while crumb is not None:\n
if crumb.getPortalType() == \'Web Site\':\n if crumb.getPortalType() == \'Web Site\':\n
crumb = None # Don\'t go higher than the first Web Site found\n crumb = None # Don\'t go higher than the first Web Site found\n
else:\n else:\n
crumb = crumb.aq_parent # Acquisition through context\n # try accessing parent object (which might not always be possible)\n
\n try:\n
crumb = crumb.aq_parent\n
except:\n
crumb = None\n
\n
crumb_list.reverse()\n crumb_list.reverse()\n
return crumb_list\n return crumb_list\n
</string> </value> </string> </value>
......
627 628
\ 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