From 257ee130fb637e27710a5115dbf51c132cdd24d3 Mon Sep 17 00:00:00 2001 From: Lorenzo Balugani Date: Mon, 17 May 2021 16:27:01 +0200 Subject: [PATCH] Fixed minor oversight --- nest_backend/routes/repository/alerts/alert.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nest_backend/routes/repository/alerts/alert.py b/nest_backend/routes/repository/alerts/alert.py index 50a63fd..2144485 100644 --- a/nest_backend/routes/repository/alerts/alert.py +++ b/nest_backend/routes/repository/alerts/alert.py @@ -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":