From 44d2dd3d52ab7b57ce2fe3de8368d557ef2e9fce Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Fri, 13 Nov 2026 05:03:00 -0500 Subject: [PATCH] feat: deleting an account removes the access grants that name it (#34223) --- backend/open_webui/models/users.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/open_webui/models/users.py b/backend/open_webui/models/users.py index 557e9d84f7..8e69411c67 100644 --- a/backend/open_webui/models/users.py +++ b/backend/open_webui/models/users.py @@ -863,6 +863,9 @@ class UsersTable: from open_webui.models.chat_views import ChatViewState await session.execute(delete(ChatViewState).where(ChatViewState.user_id == id)) + from open_webui.models.access_grants import AccessGrant + + await session.execute(delete(AccessGrant).filter_by(principal_type='user', principal_id=id)) await session.execute(delete(User).where(User.id == id)) await session.commit() return True