Skip to content

Commit

Permalink
Make the INCIDENT_LEVEL_CHOICES immutable
Browse files Browse the repository at this point in the history
INCIDENT_LEVEL_CHOICES was behaving oddly. This fixes it.
  • Loading branch information
hmpf committed Jul 26, 2024
1 parent e36f152 commit aa58601
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang

<!-- towncrier release notes start -->

## [1.20.1] - 2024-07-26

### Fixed

- `INCIDENT_LEVEL_CHOICES` was behaving oddly when debugging so it has been
made a proper immutable constant.

## [1.20.0] - 2024-07-25


Expand Down
2 changes: 1 addition & 1 deletion src/argus/incident/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
MIN_INCIDENT_LEVEL = 1 # Do not override
MAX_INCIDENT_LEVEL = 5
INCIDENT_LEVELS = tuple(range(MIN_INCIDENT_LEVEL, MAX_INCIDENT_LEVEL + 1))
INCIDENT_LEVEL_CHOICES = zip(INCIDENT_LEVELS, map(str, INCIDENT_LEVELS))
INCIDENT_LEVEL_CHOICES = tuple(zip(INCIDENT_LEVELS, map(str, INCIDENT_LEVELS)))

0 comments on commit aa58601

Please sign in to comment.