Commit 1edfbbbf authored by Yoshinori Okuji's avatar Yoshinori Okuji

_getExtensibleContent was not working with unrestrictedTraverse, because it...

_getExtensibleContent was not working with unrestrictedTraverse, because it provides a fake request as just a plain dict object, thus request.other does not exist, and UserFolder.validate only raises an exception.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22053 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1b76e57e
......@@ -276,13 +276,24 @@ class PermanentURLMixIn(ExtensibleTraversableMixIn):
try:
if request.get('PUBLISHED', _MARKER) is _MARKER:
# request['PUBLISHED'] is required by validate
request.other['PUBLISHED'] = self
request['PUBLISHED'] = self
has_published = False
else:
has_published = True
user = user_folder.validate(request)
try:
user = user_folder.validate(request)
except AttributeError:
# This kind of error happens with unrestrictedTraverse,
# because the request object is a fake, and it is just
# a dict object.
user = None
if not has_published:
del request.other['PUBLISHED']
try:
del request.other['PUBLISHED']
except AttributeError:
# The same here as above. unrestrictedTraverse provides
# just a plain dict, so request.other does not exist.
del request['PUBLISHED']
except:
LOG("ERP5 WARNING",0,
"Failed to retrieve user in __bobo_traverse__ of WebSection %s" % self.getPath(),
......
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