[pricelist] Delete old images
This commit is contained in:
parent
d00c603697
commit
795475fe15
|
@ -525,7 +525,7 @@ def delete_extra_ingredient(identifier):
|
|||
|
||||
|
||||
def save_drink_picture(identifier, file):
|
||||
drink = get_drink(identifier)
|
||||
drink = delete_drink_picture(identifier)
|
||||
drink.image_ = image_controller.upload_image(file)
|
||||
db.session.commit()
|
||||
return drink
|
||||
|
@ -533,6 +533,8 @@ def save_drink_picture(identifier, file):
|
|||
|
||||
def delete_drink_picture(identifier):
|
||||
drink = get_drink(identifier)
|
||||
drink.image = None
|
||||
if drink.image_:
|
||||
db.session.delete(drink.image_)
|
||||
drink.image_ = None
|
||||
db.session.commit()
|
||||
return drink
|
||||
|
|
Loading…
Reference in New Issue