[pricelist] Fix minor issues
This commit is contained in:
parent
e3d0014e62
commit
6a9db1b36a
|
@ -710,7 +710,7 @@ def get_priclist_setting(userid, current_session):
|
|||
return no_content()
|
||||
|
||||
|
||||
@PriceListPlugin.blueprint.route("/drinks/<int:identifier>/picture", methods=["POST" "DELETE"])
|
||||
@PriceListPlugin.blueprint.route("/drinks/<int:identifier>/picture", methods=["POST", "DELETE"])
|
||||
@login_required(permission=permissions.EDIT)
|
||||
def set_picture(identifier, current_session):
|
||||
"""Get, Create, Delete Drink Picture
|
||||
|
|
|
@ -302,7 +302,7 @@ def update_drink(identifier, data):
|
|||
else:
|
||||
drink = get_drink(identifier)
|
||||
for key, value in data.items():
|
||||
if hasattr(drink, key):
|
||||
if hasattr(drink, key) and key != 'has_image':
|
||||
setattr(drink, key, value if value != "" else None)
|
||||
|
||||
if drink_type:
|
||||
|
@ -531,7 +531,7 @@ def delete_extra_ingredient(identifier):
|
|||
|
||||
def save_drink_picture(identifier, file):
|
||||
drink = get_drink(identifier)
|
||||
drink.image = image_controller.upload_image(file)
|
||||
drink.image_ = image_controller.upload_image(file)
|
||||
db.session.commit()
|
||||
return drink
|
||||
|
||||
|
|
Loading…
Reference in New Issue