Skip to content

Commit

Permalink
Be more defensive in content.get_user_fullname, in some case, a use…
Browse files Browse the repository at this point in the history
…rid is found in `mutable_properties` but there is no properties associated with it.
  • Loading branch information
gbastien committed Jul 13, 2023
1 parent ff262c5 commit e6b2b67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ Changelog
0.73 (unreleased)
-----------------

- Nothing changed yet.

- Be more defensive in `content.get_user_fullname`, in some case, a userid
is found in `mutable_properties` but there is no properties associated with it.
[gbastien]

0.72 (2023-07-12)
-----------------
Expand Down
4 changes: 3 additions & 1 deletion src/imio/helpers/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,9 @@ def get_user_fullname(userid, none_if_no_user=False, none_if_unfound=False):
# this is necessary sometimes when using LDAP
if not fullname:
mt = api.portal.get_tool('portal_membership')
fullname = mt.getMemberInfo(userid).get('fullname', '')
info = mt.getMemberInfo(userid)
if info:
fullname = info.get('fullname', '')
return safe_unicode(fullname) or userid


Expand Down

0 comments on commit e6b2b67

Please sign in to comment.