diff options
author | 2021-10-06 23:20:56 +0200 | |
---|---|---|
committer | 2021-10-06 23:22:45 +0200 | |
commit | ce75197fc1d0b2086631277d29f9396908bdc86c (patch) | |
tree | 2eab9855ab1a83352a5d83050d8a1fc0524f3285 /pydis_site/apps/api/models | |
parent | Merge branch 'main' into subdomains-to-query-paths (diff) | |
parent | Merge pull request #599 from python-discord/fix-http-links (diff) |
Merge branch 'master' into subdomains-to-query-paths
Diffstat (limited to 'pydis_site/apps/api/models')
-rw-r--r-- | pydis_site/apps/api/models/bot/documentation_link.py | 1 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/metricity.py | 10 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/off_topic_channel_name.py | 2 | ||||
-rw-r--r-- | pydis_site/apps/api/models/utils.py | 2 |
4 files changed, 8 insertions, 7 deletions
diff --git a/pydis_site/apps/api/models/bot/documentation_link.py b/pydis_site/apps/api/models/bot/documentation_link.py index 3dcc71fc..9941907c 100644 --- a/pydis_site/apps/api/models/bot/documentation_link.py +++ b/pydis_site/apps/api/models/bot/documentation_link.py @@ -30,6 +30,7 @@ class DocumentationLink(ModelReprMixin, models.Model): "The base URL from which documentation will be available for this project. " "Used to generate links to various symbols within this package." ), + blank=True, validators=(ends_with_slash_validator,) ) inventory_url = models.URLField( diff --git a/pydis_site/apps/api/models/bot/metricity.py b/pydis_site/apps/api/models/bot/metricity.py index 5daa5c66..33fb7ad7 100644 --- a/pydis_site/apps/api/models/bot/metricity.py +++ b/pydis_site/apps/api/models/bot/metricity.py @@ -10,7 +10,7 @@ EXCLUDE_CHANNELS = [ ] -class NotFound(Exception): +class NotFoundError(Exception): """Raised when an entity cannot be found.""" pass @@ -37,7 +37,7 @@ class Metricity: values = self.cursor.fetchone() if not values: - raise NotFound() + raise NotFoundError() return dict(zip(columns, values)) @@ -58,7 +58,7 @@ class Metricity: values = self.cursor.fetchone() if not values: - raise NotFound() + raise NotFoundError() return values[0] @@ -88,7 +88,7 @@ class Metricity: values = self.cursor.fetchone() if not values: - raise NotFound() + raise NotFoundError() return values[0] @@ -127,6 +127,6 @@ class Metricity: values = self.cursor.fetchall() if not values: - raise NotFound() + raise NotFoundError() return values diff --git a/pydis_site/apps/api/models/bot/off_topic_channel_name.py b/pydis_site/apps/api/models/bot/off_topic_channel_name.py index 403c7465..8999e560 100644 --- a/pydis_site/apps/api/models/bot/off_topic_channel_name.py +++ b/pydis_site/apps/api/models/bot/off_topic_channel_name.py @@ -11,7 +11,7 @@ class OffTopicChannelName(ModelReprMixin, models.Model): primary_key=True, max_length=96, validators=( - RegexValidator(regex=r"^[a-z0-9\U0001d5a0-\U0001d5b9-ǃ?’']+$"), + RegexValidator(regex=r"^[a-z0-9\U0001d5a0-\U0001d5b9-ǃ?’'<>]+$"), ), help_text="The actual channel name that will be used on our Discord server." ) diff --git a/pydis_site/apps/api/models/utils.py b/pydis_site/apps/api/models/utils.py index 107231ba..0e220a1d 100644 --- a/pydis_site/apps/api/models/utils.py +++ b/pydis_site/apps/api/models/utils.py @@ -142,7 +142,7 @@ def validate_embed(embed: Any) -> None: ), MaxLengthValidator(limit_value=256) ), - 'description': (MaxLengthValidator(limit_value=2048),), + 'description': (MaxLengthValidator(limit_value=4096),), 'fields': ( MaxLengthValidator(limit_value=25), validate_embed_fields |