From 682dd093b7e3ca563bdee044233f5133fdc90912 Mon Sep 17 00:00:00 2001 From: Mateusz779 Date: Fri, 14 Apr 2023 14:22:08 +0200 Subject: [PATCH] - --- db.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/db.py b/db.py index fafa1d0..7400161 100644 --- a/db.py +++ b/db.py @@ -250,22 +250,13 @@ def del_image_allocation_token(token): if id_image is None: return None - connect() - with get_cur() as cur: - cur.execute(""" - DELETE FROM image_allocation WHERE id_image = %s - """,(id_image,)) - try: - conn.commit() - return True - except: - return None + return del_image_allocation_id_image(id_image) def del_image_allocation_id_image(id_image): connect() with get_cur() as cur: cur.execute(""" - DELETE FROM image_allocation WHERE id_image = %s + DELETE FROM image_allocation WHERE image_id = %s """,(id_image,)) try: conn.commit()