From 2d45c0dab9a46648744c3c590ea8bb6fe7e75e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Wed, 14 Apr 2021 20:11:23 +0200 Subject: [PATCH] [pricelist] delete visibleColums --- flaschengeist/plugins/pricelist/__init__.py | 34 +-------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/flaschengeist/plugins/pricelist/__init__.py b/flaschengeist/plugins/pricelist/__init__.py index 117aa3f..0f56111 100644 --- a/flaschengeist/plugins/pricelist/__init__.py +++ b/flaschengeist/plugins/pricelist/__init__.py @@ -198,39 +198,7 @@ def pricelist_settings_min_prices(): data.sort() PriceListPlugin.plugin.set_setting("min_prices", data) return no_content() - - -@PriceListPlugin.blueprint.route("/users//pricecalc_columns", methods=["GET", "PUT"]) -@login_required() -def get_columns(userid, current_session: Session): - """Get pricecalc_columns of an user - - Route: ``/users//pricelist/pricecac_columns`` | Method: ``GET`` or ``PUT`` - POST-data: On ``PUT`` json encoded array of floats - - Args: - userid: Userid identifying the user - current_session: Session sent with Authorization Header - - Returns: - GET: JSON object containing the shortcuts as float array or HTTP error - PUT: HTTP-created or HTTP error - """ - if userid != current_session.user_.userid: - raise Forbidden - - user = userController.get_user(userid) - if request.method == "GET": - return jsonify(user.get_attribute("pricecalc_columns", [])) - else: - data = request.get_json() - if not isinstance(data, list) or not all(isinstance(n, str) for n in data): - raise BadRequest - data.sort(reverse=True) - user.set_attribute("pricecalc_columns", data) - userController.persist() - return no_content() - + @PriceListPlugin.blueprint.route("/drinks//picture", methods=["POST", "GET", "DELETE"]) def set_picture(identifier):