This commit is contained in:
Mateusz779 2023-04-14 14:22:08 +02:00
parent bb6f3f68d4
commit 682dd093b7

13
db.py
View File

@ -250,22 +250,13 @@ def del_image_allocation_token(token):
if id_image is None: if id_image is None:
return None return None
connect() return del_image_allocation_id_image(id_image)
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_image(id_image): def del_image_allocation_id_image(id_image):
connect() connect()
with get_cur() as cur: with get_cur() as cur:
cur.execute(""" cur.execute("""
DELETE FROM image_allocation WHERE id_image = %s DELETE FROM image_allocation WHERE image_id = %s
""",(id_image,)) """,(id_image,))
try: try:
conn.commit() conn.commit()