Skip to content

Commit 2b773d5

Browse files
authored
Merge pull request #425 from simvue-io/hotfix/type-error-validation
Fix type-error issue during validation parse
2 parents c2eece8 + d823772 commit 2b773d5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

simvue/utilities.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ def parse_validation_response(
6363
headers = ["Type", "Location", "Input", "Message"]
6464
input_arg = body
6565
for loc in location:
66-
input_arg = input_arg[loc]
66+
try:
67+
input_arg = input_arg[loc]
68+
except TypeError:
69+
break
6770
information.append(input_arg)
6871

6972
msg: str = issue["msg"]
@@ -332,9 +335,9 @@ def validate_timestamp(timestamp):
332335

333336
def compare_alerts(first, second):
334337
""" """
335-
for key in ("name", "description", "source", "frequency", "notification", "abort"):
338+
for key in ("name", "description", "source", "frequency", "notification"):
336339
if key in first and key in second:
337-
if first[key] is None:
340+
if not first[key]:
338341
continue
339342

340343
if first[key] != second[key]:
@@ -343,7 +346,7 @@ def compare_alerts(first, second):
343346
if "alerts" in first and "alerts" in second:
344347
for key in ("rule", "window", "metric", "threshold", "range_low", "range_high"):
345348
if key in first["alerts"] and key in second["alerts"]:
346-
if first[key] is None:
349+
if not first[key]:
347350
continue
348351

349352
if first["alerts"][key] != second["alerts"]["key"]:

0 commit comments

Comments
 (0)