Commit c7621e4d authored by Yoshinori Okuji's avatar Yoshinori Okuji

Make sure that the original user is restored when portal_catalog fails.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9014 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 99c79f4d
...@@ -173,9 +173,10 @@ class ERP5UserManager(BasePlugin): ...@@ -173,9 +173,10 @@ class ERP5UserManager(BasePlugin):
if sm.getUser() != SUPER_USER: if sm.getUser() != SUPER_USER:
newSecurityManager(self, self.getUser(SUPER_USER)) newSecurityManager(self, self.getUser(SUPER_USER))
try:
result = self.getPortalObject().portal_catalog( result = self.getPortalObject().portal_catalog(
portal_type="Person", reference=login) portal_type="Person", reference=login)
finally:
setSecurityManager(sm) setSecurityManager(sm)
return [item.getObject() for item in result] return [item.getObject() for item in result]
......
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