[pricelist] Fix minor issues

This commit is contained in:
Ferdinand Thiessen 2021-11-15 17:05:18 +01:00
parent e3d0014e62
commit 6a9db1b36a
2 changed files with 3 additions and 3 deletions

View File

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

View File

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