From b38819fdaabe7f2c09a5f5e0c5be00534bb29df7 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Wed, 14 Jun 2023 14:40:01 +0200 Subject: [PATCH] fix: [user] fix user delete #163 --- bin/lib/Users.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/lib/Users.py b/bin/lib/Users.py index 2c231396..dc6a1368 100755 --- a/bin/lib/Users.py +++ b/bin/lib/Users.py @@ -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)