Commit bcfb6c43 authored by Nicolas Dumazet's avatar Nicolas Dumazet

dont use getToolByName, dont crash if portal_membership isnt here.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42363 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 86af2dbb
No related merge requests found
...@@ -1211,8 +1211,8 @@ def createExpressionContext(object, portal=None): ...@@ -1211,8 +1211,8 @@ def createExpressionContext(object, portal=None):
folder = aq_parent(aq_inner(folder)) folder = aq_parent(aq_inner(folder))
if portal is not None: if portal is not None:
pm = getToolByName(portal, 'portal_membership') pm = getattr(portal, 'portal_membership', None)
if pm.isAnonymousUser(): if pm is None or pm.isAnonymousUser():
member = None member = None
else: else:
member = pm.getAuthenticatedMember() member = pm.getAuthenticatedMember()
......
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