1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 04:54:18 +00:00

Fixed minor oversight

This commit is contained in:
Lorenzo Balugani 2021-05-17 16:27:01 +02:00
parent 8b2080b8cd
commit 257ee130fb

View file

@ -129,6 +129,13 @@ def page_alert(aid):
alert.limit = request.json['limit']
if 'window_size' in request.json:
alert.window_size = request.json['window_size']
if 'evaluation_mode' in request.json:
try:
alert.evaluation_mode = ConditionMode(request.json['evaluation_mode'])
except KeyError:
return json_error("Unknown `type` specified.", GENERIC_ENUM_INVALID), 400
except Exception as e:
return json_error("Unknown error:" + str(e), GENERIC_UFO), 400
ext.session.commit()
return json_success(alert.to_json()), 204
elif request.method == "DELETE":