diff options
Diffstat (limited to 'gn_auth/auth/authorisation/resources/groups/models.py')
-rw-r--r-- | gn_auth/auth/authorisation/resources/groups/models.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gn_auth/auth/authorisation/resources/groups/models.py b/gn_auth/auth/authorisation/resources/groups/models.py index f067135..8b1df90 100644 --- a/gn_auth/auth/authorisation/resources/groups/models.py +++ b/gn_auth/auth/authorisation/resources/groups/models.py @@ -344,8 +344,8 @@ def remove_user_from_group( """Add `user` to `group` as a member.""" with db.cursor(conn) as cursor: cursor.execute( - ("INSERT INTO group_users VALUES (:group_id, :user_id) " - "ON CONFLICT (group_id, user_id) DO NOTHING"), + "DELETE FROM group_users " + "WHERE group_id=:group_id AND user_id=:user_id", {"group_id": str(group.group_id), "user_id": str(user.user_id)}) assign_user_role_by_name(cursor, user, |