Commit 11a5996a authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

use getUserName() explicitly instead of __str__().

parent 23ec1015
...@@ -288,8 +288,8 @@ class ERP5UserManager(BasePlugin): ...@@ -288,8 +288,8 @@ class ERP5UserManager(BasePlugin):
return [] return []
if isinstance(login, list): if isinstance(login, list):
login = tuple(login) login = tuple(login)
elif not isinstance(login, tuple): elif not isinstance(login, (tuple, str)):
login = str(login) login = login.getUserName()
try: try:
return getUserByLogin(self.getPortalObject(), login, exact_match) return getUserByLogin(self.getPortalObject(), login, exact_match)
except ConflictError: except ConflictError:
......
...@@ -105,9 +105,9 @@ def super_user(): ...@@ -105,9 +105,9 @@ def super_user():
uf = getSite().acl_users uf = getSite().acl_users
role_list = uf.valid_roles() role_list = uf.valid_roles()
if anonymous: if anonymous:
# If the user is anonymous, use the id of the system user, # If the user is anonymous, use the user name of the system user,
# so that it would not be treated as an unauthorized user. # so that it would not be treated as an unauthorized user.
user_id = str(system) user_id = system.getUserName()
else: else:
user_id = user.getId() user_id = user.getId()
super_user = PrivilegedUser(user_id, None, super_user = PrivilegedUser(user_id, None,
......
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