[Plugin] balance: Fixed shortcut data type check

This commit is contained in:
Ferdinand Thiessen 2021-01-22 00:17:51 +01:00
parent 826893e42e
commit c4b80f27ee
1 changed files with 1 additions and 1 deletions

View File

@ -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()