fix: [user] fix user delete #163

This commit is contained in:
Terrtia 2023-06-14 14:40:01 +02:00
parent f3946cc4f3
commit b38819fdaa
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -156,7 +156,8 @@ def delete_user(user_id):
for role_id in get_all_roles():
r_serv_db.srem(f'ail:users:role:{role_id}', user_id)
user_token = get_user_token(user_id)
r_serv_db.hdel('ail:users:tokens', user_token)
if user_token:
r_serv_db.hdel('ail:users:tokens', user_token)
r_serv_db.delete(f'ail:user:metadata:{user_id}')
r_serv_db.hdel('ail:users:all', user_id)