From d03ac5fbf06bc3749e68a606601c0b793f1f0766 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Wed, 15 Jul 2020 14:29:32 +0200 Subject: Set up url forwarding for the viewset. https://github.com/python-discord/site/issues/305 --- pydis_site/apps/api/models/bot/allowlist.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'pydis_site/apps/api/models') diff --git a/pydis_site/apps/api/models/bot/allowlist.py b/pydis_site/apps/api/models/bot/allowlist.py index c8fa2e33..b0aea066 100644 --- a/pydis_site/apps/api/models/bot/allowlist.py +++ b/pydis_site/apps/api/models/bot/allowlist.py @@ -1,23 +1,21 @@ from django.db import models -from pydis_site.apps.api.models import ModelReprMixin, ModelTimestampMixin +from pydis_site.apps.api.models.mixins import ModelReprMixin, ModelTimestampMixin class AllowList(ModelTimestampMixin, ModelReprMixin, models.Model): """An item that is either allowed or denied.""" AllowListType = models.TextChoices( - 'guild_invite_id', - 'file_format', - 'domain_name', - 'word_watchlist', + 'AllowListType', + 'GUILD_INVITE_ID ' + 'FILE_FORMAT ' + 'DOMAIN_NAME ' + 'WORD_WATCHLIST ' ) type = models.CharField( max_length=50, - help_text=( - "The type of allowlist this is on. The value must be one of the following: " - f"{','.join(AllowListType.choices)}." - ), + help_text="The type of allowlist this is on.", choices=AllowListType.choices, ) allowed = models.BooleanField( -- cgit v1.2.3