diff options
author | 2020-07-27 09:53:38 +0200 | |
---|---|---|
committer | 2020-07-27 09:53:38 +0200 | |
commit | 285c81bc13e996246ad9463951853fc12903d766 (patch) | |
tree | ce6d40f8bdf494cb438f94676e16fbf98c167a37 /pydis_site/apps/api/models | |
parent | Minor changes to tests, use subTest. (diff) |
Rename AllowDenyList to FilterList
Diffstat (limited to 'pydis_site/apps/api/models')
-rw-r--r-- | pydis_site/apps/api/models/__init__.py | 2 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/__init__.py | 2 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/filter_list.py (renamed from pydis_site/apps/api/models/bot/allow_deny_list.py) | 12 |
3 files changed, 8 insertions, 8 deletions
diff --git a/pydis_site/apps/api/models/__init__.py b/pydis_site/apps/api/models/__init__.py index 34973a8d..1d0ab7ea 100644 --- a/pydis_site/apps/api/models/__init__.py +++ b/pydis_site/apps/api/models/__init__.py @@ -1,6 +1,6 @@ # flake8: noqa from .bot import ( - AllowDenyList, + FilterList, BotSetting, DocumentationLink, DeletedMessage, diff --git a/pydis_site/apps/api/models/bot/__init__.py b/pydis_site/apps/api/models/bot/__init__.py index 1234b35a..efd98184 100644 --- a/pydis_site/apps/api/models/bot/__init__.py +++ b/pydis_site/apps/api/models/bot/__init__.py @@ -1,5 +1,5 @@ # flake8: noqa -from .allow_deny_list import AllowDenyList +from .filter_list import FilterList from .bot_setting import BotSetting from .deleted_message import DeletedMessage from .documentation_link import DocumentationLink diff --git a/pydis_site/apps/api/models/bot/allow_deny_list.py b/pydis_site/apps/api/models/bot/filter_list.py index e1e09a78..d279e137 100644 --- a/pydis_site/apps/api/models/bot/allow_deny_list.py +++ b/pydis_site/apps/api/models/bot/filter_list.py @@ -3,11 +3,11 @@ from django.db import models from pydis_site.apps.api.models.mixins import ModelReprMixin, ModelTimestampMixin -class AllowDenyList(ModelTimestampMixin, ModelReprMixin, models.Model): +class FilterList(ModelTimestampMixin, ModelReprMixin, models.Model): """An item that is either allowed or denied.""" - AllowDenyListType = models.TextChoices( - 'AllowDenyListType', + FilterListType = models.TextChoices( + 'FilterListType', 'GUILD_INVITE ' 'FILE_FORMAT ' 'DOMAIN_NAME ' @@ -16,7 +16,7 @@ class AllowDenyList(ModelTimestampMixin, ModelReprMixin, models.Model): type = models.CharField( max_length=50, help_text="The type of allowlist this is on.", - choices=AllowDenyListType.choices, + choices=FilterListType.choices, ) allowed = models.BooleanField( help_text="Whether this item is on the allowlist or the denylist." @@ -32,10 +32,10 @@ class AllowDenyList(ModelTimestampMixin, ModelReprMixin, models.Model): class Meta: """Metaconfig for this model.""" - # This constraint ensures only one allow or denylist with the + # This constraint ensures only one filterlist with the # same content can exist. This means that we cannot have both an allow # and a deny for the same item, and we cannot have duplicates of the # same item. constraints = [ - models.UniqueConstraint(fields=['content', 'type'], name='unique_allow_deny_list'), + models.UniqueConstraint(fields=['content', 'type'], name='unique_filter_list'), ] |