Commit e8ae14a5 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Vincent Pelletier

use getUserName() explicitly instead of __str__().

parent b0113856
......@@ -287,8 +287,8 @@ class ERP5UserManager(BasePlugin):
return []
if isinstance(login, list):
login = tuple(login)
elif not isinstance(login, tuple):
login = str(login)
elif not isinstance(login, (tuple, str)):
login = login.getUserName()
try:
return getUserByLogin(self.getPortalObject(), login, exact_match)
except ConflictError:
......
......@@ -105,9 +105,9 @@ def super_user():
uf = getSite().acl_users
role_list = uf.valid_roles()
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.
user_id = str(system)
user_id = system.getUserName()
else:
user_id = user.getId()
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