Skip to content

Commit

Permalink
Run pyupgrade
Browse files Browse the repository at this point in the history
pyupgrade --py38-plus --keep-runtime-typing --keep-percent-format  $(find . -name '*.py')
  • Loading branch information
Viicos committed Jan 17, 2024
1 parent d96386f commit 8486715
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/objects/accounts/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/objects/utils/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
2 changes: 1 addition & 1 deletion src/objects/utils/migration_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/objects/utils/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions src/objects/utils/templatetags/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def placekitten(width=800, height=600):
{%placekitten %}
{%placekitten 200 200 %}
"""
return format_html('<img src="{}" />'.format(placekitten_src(width, height)))
return format_html(f'<img src="{placekitten_src(width, height)}" />')


@register.simple_tag
Expand All @@ -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}"

0 comments on commit 8486715

Please sign in to comment.