From 6509b5d73259a86ab9c27b53572e5cee3d20df9c Mon Sep 17 00:00:00 2001 From: terrtia Date: Tue, 17 Sep 2024 15:10:43 +0200 Subject: [PATCH] fix: [delete user] remove user from org --- bin/lib/ail_users.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/lib/ail_users.py b/bin/lib/ail_users.py index 72e3b689..e000444e 100755 --- a/bin/lib/ail_users.py +++ b/bin/lib/ail_users.py @@ -586,6 +586,10 @@ class AILUser(UserMixin): user_token = self.get_api_key() if user_token: r_serv_db.hdel('ail:users:tokens', user_token) + user_org = self.get_org() + if user_org: + org = ail_orgs.Organisation(user_org) + org.remove_user(self.user_id) r_serv_db.delete(f'ail:user:metadata:{self.user_id}') r_serv_db.hdel('ail:users:all', self.user_id)