let adopt_user get to the zope admin user

This commit is contained in:
Frédéric Péters 2014-03-24 11:31:19 +01:00
parent be292e7867
commit 6aae162385
1 changed files with 4 additions and 1 deletions

View File

@ -39,7 +39,10 @@ def adopt_user(username=None, user=None):
acl_users = portal.get().acl_users
unwrapped = acl_users.getUser(username)
if unwrapped is None:
raise UserNotFoundError
acl_users = portal.get().unrestrictedTraverse('/').acl_users
unwrapped = acl_users.getUser(username)
if unwrapped is None:
raise UserNotFoundError
# ZopeSecurityPolicy appears to strongly expect the user object to
# be Acquisition-wrapped in the acl_users from which it was taken.