From ddedfbfdc12edf4b90365479120217a2bac1f75a Mon Sep 17 00:00:00 2001 From: Vlad Makarenko Date: Thu, 26 Mar 2020 09:58:13 +0000 Subject: [PATCH] fixed bug https://github.com/MPDL/KEEPER/issues/401: Optimize form of address in Certificate e-mail --- .../seafile-server-latest/seahub/keeper/utils.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/seafile_keeper_ext/seafile-server-latest/seahub/keeper/utils.py b/seafile_keeper_ext/seafile-server-latest/seahub/keeper/utils.py index 9901a564..e0b4d0f3 100755 --- a/seafile_keeper_ext/seafile-server-latest/seahub/keeper/utils.py +++ b/seafile_keeper_ext/seafile-server-latest/seahub/keeper/utils.py @@ -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