diff options
author | 2019-12-19 13:36:08 -0800 | |
---|---|---|
committer | 2019-12-19 13:36:08 -0800 | |
commit | 438e947d7edaf1f9dfa10bea0a2adf20e0ebbc9f (patch) | |
tree | 5a5e5cfb38044ea8e2716dd654bad38af2415419 /pydis_site/apps/api/models | |
parent | Output errors more clearly for infraction serializer test failures (diff) |
Remove default value from the active field of infractions
Due to the active field being specified in the UniqueTogetherValidator,
the field is implicitly required. Typically default values are excluded
from this restriction but in this case some infraction types must always
be False.
It's easier and makes more sense to require the active field explicitly
rather than to write logic in the serializer which is conditional on the
type of infractions.
Diffstat (limited to 'pydis_site/apps/api/models')
-rw-r--r-- | pydis_site/apps/api/models/bot/infraction.py | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/pydis_site/apps/api/models/bot/infraction.py b/pydis_site/apps/api/models/bot/infraction.py index 108fd3a2..f58e89a3 100644 --- a/pydis_site/apps/api/models/bot/infraction.py +++ b/pydis_site/apps/api/models/bot/infraction.py @@ -29,7 +29,6 @@ class Infraction(ModelReprMixin, models.Model): ) ) active = models.BooleanField( - default=True, help_text="Whether the infraction is still active." ) user = models.ForeignKey( |