diff options
author | 2021-07-11 15:58:32 +0800 | |
---|---|---|
committer | 2021-12-18 18:02:11 +0100 | |
commit | 6694ac4159c6d0f17451997df7f20b1363952ef3 (patch) | |
tree | 913b75cb119046b157bb90de7d2ef6a1adab726e /pydis_site/apps/api | |
parent | Improve help text message. (diff) |
Fix faulty model enumeration.
This also allows us to simplify the str dunder for a FilterList.
Diffstat (limited to 'pydis_site/apps/api')
-rw-r--r-- | pydis_site/apps/api/models/bot/filters.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pydis_site/apps/api/models/bot/filters.py b/pydis_site/apps/api/models/bot/filters.py index a2d3af6a..6f35bfb0 100644 --- a/pydis_site/apps/api/models/bot/filters.py +++ b/pydis_site/apps/api/models/bot/filters.py @@ -9,8 +9,8 @@ from django.db.models import UniqueConstraint class FilterListType(models.IntegerChoices): """Choice between allow or deny for a list type.""" - ALLOW: 1 - DENY: 0 + ALLOW = 1 + DENY = 0 class InfractionType(models.TextChoices): @@ -64,7 +64,7 @@ class FilterList(models.Model): ) def __str__(self) -> str: - return f"Filter {'allow' if self.list_type == 1 else 'deny'}list {self.name!r}" + return f"Filter {FilterListType(self.list_type).label}list {self.name!r}" class FilterSettings(models.Model): |