This commit is contained in:
Mateusz779 2023-04-14 14:19:37 +02:00
parent 6eb9729742
commit bb6f3f68d4
2 changed files with 13 additions and 1 deletions

2
app.py
View File

@ -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")

12
db.py
View File

@ -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: