Skip to content

Commit

Permalink
fixed bug #401: Optimize form of address in Certificate e-mail
Browse files Browse the repository at this point in the history
  • Loading branch information
vmakarenko committed Mar 26, 2020
1 parent db3de81 commit ddedfbf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions seafile_keeper_ext/seafile-server-latest/seahub/keeper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,13 @@ def get_user_name(user):
"""Get user name"""
# default name is user id
name = user
p = Profile.objects.get_profile_by_user(user)
if p and p.nickname:
name = p.nickname
return name
try:
p = Profile.objects.get_profile_by_user(user)
if p is not None and p.nickname:
name = p.nickname
except Exception as e:
logging.error(str(e))
return name


# KEEPER ARCHIVING
Expand Down

0 comments on commit ddedfbf

Please sign in to comment.