-
This commit is contained in:
parent
bb6f3f68d4
commit
682dd093b7
13
db.py
13
db.py
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user