Skip to content

Commit

Permalink
Merge pull request #277 from networktocode/validate_empty_circuits-re…
Browse files Browse the repository at this point in the history
…finement

refactor:  `validate_empty_circuits` using enums
  • Loading branch information
chadell authored Mar 18, 2024
2 parents ac4417e + 8f3d316 commit 7162407
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion circuit_maintenance_parser/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def validate_empty_strings(cls, value):
def validate_empty_circuits(cls, value, values):
"""Validate non-cancel notifications have a populated circuit list."""
values = values.data
if len(value) < 1 and str(values["status"]) not in ("Status.CANCELLED", "Status.COMPLETED"):
if len(value) < 1 and values["status"] not in (Status.CANCELLED, Status.COMPLETED):
raise ValueError("At least one circuit has to be included in the maintenance")
return value

Expand Down

0 comments on commit 7162407

Please sign in to comment.