From b00fb5fab8bd355e6f17a46121bf5f0211612a82 Mon Sep 17 00:00:00 2001 From: Levi Date: Sat, 30 Dec 2023 00:16:01 +0100 Subject: [PATCH] Fix `groups.delete_entry` query --- database/repositories/groups.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/database/repositories/groups.py b/database/repositories/groups.py index 9810c2d..660f1af 100644 --- a/database/repositories/groups.py +++ b/database/repositories/groups.py @@ -29,10 +29,12 @@ def delete_entry( group_id: int, session: Session | None = None ) -> int: - return session.query(DBGroupEntry) \ + rows = session.query(DBGroupEntry) \ .filter(DBGroupEntry.group_id == group_id) \ .filter(DBGroupEntry.user_id == user_id) \ .delete() + session.commit() + return rows @session_wrapper def fetch_one(id: int, session: Session | None = None) -> DBGroup | None: