feature/pricelist #15

Merged
ferfissimo merged 11 commits from feature/pricelist into develop 2021-11-15 09:55:11 +00:00
1 changed files with 2 additions and 2 deletions
Showing only changes of commit 1bb7bafa2a - Show all commits

View File

@ -143,6 +143,8 @@ def get_drinks(
query = query.filter(Drink.cost_per_volume >= 0) query = query.filter(Drink.cost_per_volume >= 0)
if receipt: if receipt:
query = query.filter(Drink.volumes.any(DrinkPriceVolume.ingredients != None)) query = query.filter(Drink.volumes.any(DrinkPriceVolume.ingredients != None))
if public:
query = query.filter(Drink.volumes.any(DrinkPriceVolume.prices.any(DrinkPrice.public)))
if search_name: if search_name:
if search_key == "name": if search_key == "name":
query = query.filter(Drink.name.contains(search_name)) query = query.filter(Drink.name.contains(search_name))
@ -166,8 +168,6 @@ def get_drinks(
if offset is not None: if offset is not None:
query = query.offset(offset) query = query.offset(offset)
drinks = query.all() drinks = query.all()
if public:
return [_create_public_drink(drink) for drink in drinks if _create_public_drink(drink)], count
return drinks, count return drinks, count