Skip to content

Commit

Permalink
🎨 run pyupgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
annashamray committed Jan 30, 2024
1 parent 9c27ade commit adf1a09
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/objecttypes/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
2 changes: 1 addition & 1 deletion src/objecttypes/core/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class ObjectTypeFactory(factory.django.DjangoModelFactory):
name = factory.Faker("word")
name_plural = factory.LazyAttribute(lambda x: "{}s".format(x.name))
name_plural = factory.LazyAttribute(lambda x: f"{x.name}s")
description = factory.Faker("bs")

class Meta:
Expand Down
6 changes: 3 additions & 3 deletions src/objecttypes/utils/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ 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/objecttypes/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
4 changes: 2 additions & 2 deletions src/objecttypes/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 adf1a09

Please sign in to comment.