[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()
|
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)
|
@login_required(permission=permissions.EDIT)
|
||||||
def set_picture(identifier, current_session):
|
def set_picture(identifier, current_session):
|
||||||
"""Get, Create, Delete Drink Picture
|
"""Get, Create, Delete Drink Picture
|
||||||
|
|
|
@ -302,7 +302,7 @@ def update_drink(identifier, data):
|
||||||
else:
|
else:
|
||||||
drink = get_drink(identifier)
|
drink = get_drink(identifier)
|
||||||
for key, value in data.items():
|
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)
|
setattr(drink, key, value if value != "" else None)
|
||||||
|
|
||||||
if drink_type:
|
if drink_type:
|
||||||
|
@ -531,7 +531,7 @@ def delete_extra_ingredient(identifier):
|
||||||
|
|
||||||
def save_drink_picture(identifier, file):
|
def save_drink_picture(identifier, file):
|
||||||
drink = get_drink(identifier)
|
drink = get_drink(identifier)
|
||||||
drink.image = image_controller.upload_image(file)
|
drink.image_ = image_controller.upload_image(file)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
return drink
|
return drink
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue