diff --git a/src/objects/accounts/migrations/0001_initial.py b/src/objects/accounts/migrations/0001_initial.py index 81d040b9..f91b391f 100644 --- a/src/objects/accounts/migrations/0001_initial.py +++ b/src/objects/accounts/migrations/0001_initial.py @@ -1,6 +1,4 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-01-16 14:49 -from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone diff --git a/src/objects/utils/context_processors.py b/src/objects/utils/context_processors.py index 2c7d57c2..eb7bfd03 100644 --- a/src/objects/utils/context_processors.py +++ b/src/objects/utils/context_processors.py @@ -11,9 +11,7 @@ def settings(request): ) context = { - "settings": dict( - [(k, getattr(django_settings, k, None)) for k in public_settings] - ), + "settings": {k: getattr(django_settings, k, None) for k in public_settings}, } if hasattr(django_settings, "SENTRY_CONFIG"): diff --git a/src/objects/utils/migration_operations.py b/src/objects/utils/migration_operations.py index ba82e50e..595dcc3f 100644 --- a/src/objects/utils/migration_operations.py +++ b/src/objects/utils/migration_operations.py @@ -7,7 +7,7 @@ def _get_reset_sql() -> str: INFILE = os.path.join(settings.BASE_DIR, "bin", "reset_sequences.sql") - with open(INFILE, "r") as infile: + with open(INFILE) as infile: SQL = infile.read() return SQL diff --git a/src/objects/utils/serializers.py b/src/objects/utils/serializers.py index 5e3d5c97..7cf75a48 100644 --- a/src/objects/utils/serializers.py +++ b/src/objects/utils/serializers.py @@ -140,7 +140,7 @@ def get_query_fields(self) -> list: if not fields: return [] - return list(set(field.strip() for field in fields.split(","))) + return list({field.strip() for field in fields.split(",")}) def get_allowed_fields(self, instance) -> list: request = self.context.get("request") diff --git a/src/objects/utils/templatetags/utils.py b/src/objects/utils/templatetags/utils.py index 53b319ff..62206ff0 100644 --- a/src/objects/utils/templatetags/utils.py +++ b/src/objects/utils/templatetags/utils.py @@ -47,7 +47,7 @@ def placekitten(width=800, height=600): {%placekitten %} {%placekitten 200 200 %} """ - return format_html(''.format(placekitten_src(width, height))) + return format_html(f'') @register.simple_tag @@ -61,4 +61,4 @@ def placekitten_src(width=800, height=600): {% placekitten_src 200 200 as mobile_src %} {% include 'components/image/image.html' with mobile_src=mobile_src src=src alt='placekitten' only %} """ - return "//placekitten.com/{}/{}".format(width, height) + return f"//placekitten.com/{width}/{height}"