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:
|
else:
|
||||||
info = None
|
info = None
|
||||||
user_name = "inconnu"
|
user_name = "inconnu"
|
||||||
|
else:
|
||||||
|
if user is None: # utilisateur supprimé (rare)
|
||||||
|
user_name = "inconnu !"
|
||||||
|
info = None
|
||||||
else:
|
else:
|
||||||
info = user.to_dict()
|
info = user.to_dict()
|
||||||
user_name = user.user_name
|
user_name = user.user_name
|
||||||
@ -365,7 +369,6 @@ def user_info(user_name_or_id=None, user: User = None):
|
|||||||
"status": "",
|
"status": "",
|
||||||
"date_expiration": None,
|
"date_expiration": None,
|
||||||
}
|
}
|
||||||
else:
|
|
||||||
# Ensure we never publish password hash
|
# Ensure we never publish password hash
|
||||||
if "password_hash" in info:
|
if "password_hash" in info:
|
||||||
del info["password_hash"]
|
del info["password_hash"]
|
||||||
|
Loading…
Reference in New Issue
Block a user