From bb6f3f68d4a7588b499a8b06e031b05b5d92ba58 Mon Sep 17 00:00:00 2001 From: Mateusz779 Date: Fri, 14 Apr 2023 14:19:37 +0200 Subject: [PATCH] debug --- app.py | 2 +- db.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 4d9c3cf..f4bcbaf 100644 --- a/app.py +++ b/app.py @@ -164,7 +164,7 @@ def release_allocation(): pass print(id_allocation) if id_allocation is not None: - print(db.del_image_allocation_id(id_allocation)) + print(db.del_image_allocation_id_image(id_allocation)) else: return jsonify(message="404") diff --git a/db.py b/db.py index 1c26ece..fafa1d0 100644 --- a/db.py +++ b/db.py @@ -261,6 +261,18 @@ def del_image_allocation_token(token): except: return None +def del_image_allocation_id_image(id_image): + 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 + def del_image_allocation_id(id): connect() with get_cur() as cur: