[Plugin] balance: Fixed shortcut data type check
This commit is contained in:
parent
826893e42e
commit
c4b80f27ee
|
@ -65,7 +65,7 @@ def get_shortcuts(userid, current_session: Session):
|
||||||
return jsonify(user.get_attribute("balance_shortcuts", []))
|
return jsonify(user.get_attribute("balance_shortcuts", []))
|
||||||
else:
|
else:
|
||||||
data = request.get_json()
|
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
|
raise BadRequest
|
||||||
user.set_attribute("balance_shortcuts", data)
|
user.set_attribute("balance_shortcuts", data)
|
||||||
userController.persist()
|
userController.persist()
|
||||||
|
|
Loading…
Reference in New Issue