From c4b80f27ee62f0fb873f9ca7d916afb56448e4a5 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Fri, 22 Jan 2021 00:17:51 +0100 Subject: [PATCH] [Plugin] balance: Fixed shortcut data type check --- flaschengeist/plugins/balance/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flaschengeist/plugins/balance/__init__.py b/flaschengeist/plugins/balance/__init__.py index 6860a8e..23a44ff 100644 --- a/flaschengeist/plugins/balance/__init__.py +++ b/flaschengeist/plugins/balance/__init__.py @@ -65,7 +65,7 @@ def get_shortcuts(userid, current_session: Session): return jsonify(user.get_attribute("balance_shortcuts", [])) else: data = request.get_json() - if not isinstance(data, list) or all(isinstance(n, int) for n in data): + if not isinstance(data, list) or not all(isinstance(n, (int, float)) for n in data): raise BadRequest user.set_attribute("balance_shortcuts", data) userController.persist()