forked from ScoDoc/ScoDoc
user_info: tolère comptes supprimés ou inexistants
This commit is contained in:
parent
0b5b0f8079
commit
8feff2b182
@ -342,6 +342,10 @@ def user_info(user_name_or_id=None, user: User = None):
|
||||
else:
|
||||
info = None
|
||||
user_name = "inconnu"
|
||||
else:
|
||||
if user is None: # utilisateur supprimé (rare)
|
||||
user_name = "inconnu !"
|
||||
info = None
|
||||
else:
|
||||
info = user.to_dict()
|
||||
user_name = user.user_name
|
||||
@ -365,7 +369,6 @@ def user_info(user_name_or_id=None, user: User = None):
|
||||
"status": "",
|
||||
"date_expiration": None,
|
||||
}
|
||||
else:
|
||||
# Ensure we never publish password hash
|
||||
if "password_hash" in info:
|
||||
del info["password_hash"]
|
||||
|
Loading…
Reference in New Issue
Block a user