From 32ad4471c6553387202765f48e8774a120fe5075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Wed, 14 Apr 2021 22:43:28 +0200 Subject: [PATCH] [pricelist] black code --- flaschengeist/plugins/pricelist/__init__.py | 159 ++++++++++---------- 1 file changed, 80 insertions(+), 79 deletions(-) diff --git a/flaschengeist/plugins/pricelist/__init__.py b/flaschengeist/plugins/pricelist/__init__.py index 998e046..fce9659 100644 --- a/flaschengeist/plugins/pricelist/__init__.py +++ b/flaschengeist/plugins/pricelist/__init__.py @@ -245,48 +245,48 @@ def search_drinks(name): def create_drink(current_session): """Create Drink - Route: ``/pricelist/drinks`` | Method: ``POST`` + Route: ``/pricelist/drinks`` | Method: ``POST`` - POST-data : -``{ - article_id?: string - cost_per_package?: float, - cost_per_volume?: float, - name: string, - package_size?: number, - receipt?: list[string], - tags?: list[Tag], - type: DrinkType, - uuid?: string, - volume?: float, - volumes?: list[ - { - ingredients?: list[{ - id: int - drink_ingredient?: { - ingredient_id: int, - volume: float - }, - extra_ingredient?: { - id: number, - } - }], - prices?: list[ - { - price: float - public: boolean - } - ], - volume: float - } - ] -}`` + POST-data : + ``{ + article_id?: string + cost_per_package?: float, + cost_per_volume?: float, + name: string, + package_size?: number, + receipt?: list[string], + tags?: list[Tag], + type: DrinkType, + uuid?: string, + volume?: float, + volumes?: list[ + { + ingredients?: list[{ + id: int + drink_ingredient?: { + ingredient_id: int, + volume: float + }, + extra_ingredient?: { + id: number, + } + }], + prices?: list[ + { + price: float + public: boolean + } + ], + volume: float + } + ] + }`` - Args: - current_session: Session sent with Authorization Header + Args: + current_session: Session sent with Authorization Header - Returns: - JSON encoded Drink or HTTP-error + Returns: + JSON encoded Drink or HTTP-error """ data = request.get_json() return jsonify(pricelist_controller.set_drink(data)) @@ -297,49 +297,49 @@ def create_drink(current_session): def update_drink(identifier, current_session): """Modify Drink - Route: ``/pricelist/drinks/`` | Method: ``PUT`` + Route: ``/pricelist/drinks/`` | Method: ``PUT`` - POST-data : -``{ - article_id?: string - cost_per_package?: float, - cost_per_volume?: float, - name: string, - package_size?: number, - receipt?: list[string], - tags?: list[Tag], - type: DrinkType, - uuid?: string, - volume?: float, - volumes?: list[ - { - ingredients?: list[{ - id: int - drink_ingredient?: { - ingredient_id: int, - volume: float - }, - extra_ingredient?: { - id: number, - } - }], - prices?: list[ - { - price: float - public: boolean - } - ], - volume: float - } - ] -}`` + POST-data : + ``{ + article_id?: string + cost_per_package?: float, + cost_per_volume?: float, + name: string, + package_size?: number, + receipt?: list[string], + tags?: list[Tag], + type: DrinkType, + uuid?: string, + volume?: float, + volumes?: list[ + { + ingredients?: list[{ + id: int + drink_ingredient?: { + ingredient_id: int, + volume: float + }, + extra_ingredient?: { + id: number, + } + }], + prices?: list[ + { + price: float + public: boolean + } + ], + volume: float + } + ] + }`` - Args: - identifier: Identifier of Drink - current_session: Session sent with Authorization Header + Args: + identifier: Identifier of Drink + current_session: Session sent with Authorization Header - Returns: - JSON encoded Drink or HTTP-error + Returns: + JSON encoded Drink or HTTP-error """ data = request.get_json() logger.debug(f"update drink {data}") @@ -511,6 +511,7 @@ def get_pricelist_settings_min_prices(current_session): min_prices = [] return jsonify(min_prices) + @PriceListPlugin.blueprint.route("/settings/min_prices", methods=["POST"]) @login_required(permission=permissions.EDIT_MIN_PRICES) def post_pricelist_settings_min_prices(current_session):