diff options
author | 2019-07-10 04:16:25 +0100 | |
---|---|---|
committer | 2019-07-10 04:16:25 +0100 | |
commit | dce0678b6d19fd210a5862b503ae9dcc7b894410 (patch) | |
tree | 3dec1435c12bdada903585719ff8b9abc3c1faa7 /pydis_site/apps/api/models | |
parent | Teach new lint rules to old code (diff) |
Give a code a lint
Diffstat (limited to 'pydis_site/apps/api/models')
-rw-r--r-- | pydis_site/apps/api/models/bot/bot_setting.py | 1 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/documentation_link.py | 1 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/infraction.py | 1 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/off_topic_channel_name.py | 1 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/reminder.py | 1 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/role.py | 1 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/snake_fact.py | 1 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/snake_idiom.py | 1 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/snake_name.py | 1 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/special_snake.py | 1 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/tag.py | 5 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/user.py | 1 | ||||
-rw-r--r-- | pydis_site/apps/api/models/utils.py | 1 |
13 files changed, 0 insertions, 17 deletions
diff --git a/pydis_site/apps/api/models/bot/bot_setting.py b/pydis_site/apps/api/models/bot/bot_setting.py index ee9838b7..a52f3e34 100644 --- a/pydis_site/apps/api/models/bot/bot_setting.py +++ b/pydis_site/apps/api/models/bot/bot_setting.py @@ -7,7 +7,6 @@ from pydis_site.apps.api.models.utils import ModelReprMixin def validate_bot_setting_name(name): """Raises a ValidationError if the given name is not a known setting.""" - known_settings = ( 'defcon', ) diff --git a/pydis_site/apps/api/models/bot/documentation_link.py b/pydis_site/apps/api/models/bot/documentation_link.py index 30379396..f844ae04 100644 --- a/pydis_site/apps/api/models/bot/documentation_link.py +++ b/pydis_site/apps/api/models/bot/documentation_link.py @@ -23,5 +23,4 @@ class DocumentationLink(ModelReprMixin, models.Model): def __str__(self): """Returns the package and URL for the current documentation link, for display purposes.""" - return f"{self.package} - {self.base_url}" diff --git a/pydis_site/apps/api/models/bot/infraction.py b/pydis_site/apps/api/models/bot/infraction.py index 7669352f..da91d6c2 100644 --- a/pydis_site/apps/api/models/bot/infraction.py +++ b/pydis_site/apps/api/models/bot/infraction.py @@ -60,7 +60,6 @@ class Infraction(ModelReprMixin, models.Model): def __str__(self): """Returns some info on the current infraction, for display purposes.""" - s = f"#{self.id}: {self.type} on {self.user_id}" if self.expires_at: s += f" until {self.expires_at}" 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 2f55a131..0891f811 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 @@ -16,5 +16,4 @@ class OffTopicChannelName(ModelReprMixin, models.Model): def __str__(self): """Returns the current off-topic name, for display purposes.""" - return self.name diff --git a/pydis_site/apps/api/models/bot/reminder.py b/pydis_site/apps/api/models/bot/reminder.py index ae45b5de..decc9391 100644 --- a/pydis_site/apps/api/models/bot/reminder.py +++ b/pydis_site/apps/api/models/bot/reminder.py @@ -42,5 +42,4 @@ class Reminder(ModelReprMixin, models.Model): def __str__(self): """Returns some info on the current reminder, for display purposes.""" - return f"{self.content} on {self.expiration} by {self.author}" diff --git a/pydis_site/apps/api/models/bot/role.py b/pydis_site/apps/api/models/bot/role.py index ad043bd6..34e74009 100644 --- a/pydis_site/apps/api/models/bot/role.py +++ b/pydis_site/apps/api/models/bot/role.py @@ -46,5 +46,4 @@ class Role(ModelReprMixin, models.Model): def __str__(self): """Returns the name of the current role, for display purposes.""" - return self.name diff --git a/pydis_site/apps/api/models/bot/snake_fact.py b/pydis_site/apps/api/models/bot/snake_fact.py index c960cbc4..e4486d41 100644 --- a/pydis_site/apps/api/models/bot/snake_fact.py +++ b/pydis_site/apps/api/models/bot/snake_fact.py @@ -14,5 +14,4 @@ class SnakeFact(ModelReprMixin, models.Model): def __str__(self): """Returns the current snake fact, for display purposes.""" - return self.fact diff --git a/pydis_site/apps/api/models/bot/snake_idiom.py b/pydis_site/apps/api/models/bot/snake_idiom.py index 0e8f5e94..73ce25eb 100644 --- a/pydis_site/apps/api/models/bot/snake_idiom.py +++ b/pydis_site/apps/api/models/bot/snake_idiom.py @@ -14,5 +14,4 @@ class SnakeIdiom(ModelReprMixin, models.Model): def __str__(self): """Returns the current idiom, for display purposes.""" - return self.idiom diff --git a/pydis_site/apps/api/models/bot/snake_name.py b/pydis_site/apps/api/models/bot/snake_name.py index b6ea6202..6d33f872 100644 --- a/pydis_site/apps/api/models/bot/snake_name.py +++ b/pydis_site/apps/api/models/bot/snake_name.py @@ -21,5 +21,4 @@ class SnakeName(ModelReprMixin, models.Model): def __str__(self): """Returns the regular and scientific name of the current snake, for display purposes.""" - return f"{self.name} ({self.scientific})" diff --git a/pydis_site/apps/api/models/bot/special_snake.py b/pydis_site/apps/api/models/bot/special_snake.py index 662ff8e3..5d38ab6f 100644 --- a/pydis_site/apps/api/models/bot/special_snake.py +++ b/pydis_site/apps/api/models/bot/special_snake.py @@ -24,5 +24,4 @@ class SpecialSnake(ModelReprMixin, models.Model): def __str__(self): """Returns the name of the current snake, for display purposes.""" - return self.name diff --git a/pydis_site/apps/api/models/bot/tag.py b/pydis_site/apps/api/models/bot/tag.py index 99819e42..01b49525 100644 --- a/pydis_site/apps/api/models/bot/tag.py +++ b/pydis_site/apps/api/models/bot/tag.py @@ -10,7 +10,6 @@ from pydis_site.apps.api.models.utils import ModelReprMixin def validate_tag_embed_fields(fields): """Raises a ValidationError if any of the given embed fields is invalid.""" - field_validators = { 'name': (MaxLengthValidator(limit_value=256),), 'value': (MaxLengthValidator(limit_value=1024),) @@ -30,7 +29,6 @@ def validate_tag_embed_fields(fields): def validate_tag_embed_footer(footer): """Raises a ValidationError if the given footer is invalid.""" - field_validators = { 'text': ( MinLengthValidator( @@ -56,7 +54,6 @@ def validate_tag_embed_footer(footer): def validate_tag_embed_author(author): """Raises a ValidationError if the given author is invalid.""" - field_validators = { 'name': ( MinLengthValidator( @@ -120,7 +117,6 @@ def validate_tag_embed(embed): is raised which in turn will allow Django to display errors as appropriate. """ - all_keys = { 'title', 'type', 'description', 'url', 'timestamp', 'color', 'footer', 'image', 'thumbnail', 'video', @@ -184,5 +180,4 @@ class Tag(ModelReprMixin, models.Model): def __str__(self): """Returns the title of this tag, for display purposes.""" - return self.title diff --git a/pydis_site/apps/api/models/bot/user.py b/pydis_site/apps/api/models/bot/user.py index 8b995b59..d4deb630 100644 --- a/pydis_site/apps/api/models/bot/user.py +++ b/pydis_site/apps/api/models/bot/user.py @@ -50,5 +50,4 @@ class User(ModelReprMixin, models.Model): def __str__(self): """Returns the name and discriminator for the current user, for display purposes.""" - return f"{self.name}#{self.discriminator}" diff --git a/pydis_site/apps/api/models/utils.py b/pydis_site/apps/api/models/utils.py index 8f590392..0540c4de 100644 --- a/pydis_site/apps/api/models/utils.py +++ b/pydis_site/apps/api/models/utils.py @@ -6,7 +6,6 @@ class ModelReprMixin: def __repr__(self): """Returns the current model class name and initialisation parameters.""" - attributes = ' '.join( f'{attribute}={value!r}' for attribute, value in sorted( |