Skip to content

Commit

Permalink
update Black
Browse files Browse the repository at this point in the history
  • Loading branch information
32th-System committed Jan 28, 2024
1 parent 8709ea9 commit 5bf40c9
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: psf/black@stable
- uses: psf/black@24.1.1
with:
src: "./project/thscoreboard"
16 changes: 12 additions & 4 deletions project/thscoreboard/replays/game_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ class NameLength(enum.Enum):
GameIDs.TH01: (
pgettext_lazy("short game name", "th01"),
pgettext_lazy("standard game name", "The Highly Responsive to Prayers"),
pgettext_lazy("full game name", "東方靈異伝 - The Highly Responsive to Prayers"),
pgettext_lazy(
"full game name", "東方靈異伝 - The Highly Responsive to Prayers"
),
),
GameIDs.TH02: (
pgettext_lazy("short game name", "th02"),
Expand All @@ -76,7 +78,9 @@ class NameLength(enum.Enum):
GameIDs.TH03: (
pgettext_lazy("short game name", "th03"),
pgettext_lazy("standard game name", "The Phantasmagoria of Dim. Dream"),
pgettext_lazy("full game name", "東方夢時空 - The Phantasmagoria of Dim. Dream"),
pgettext_lazy(
"full game name", "東方夢時空 - The Phantasmagoria of Dim. Dream"
),
),
GameIDs.TH04: (
pgettext_lazy("short game name", "th04"),
Expand Down Expand Up @@ -106,7 +110,9 @@ class NameLength(enum.Enum):
GameIDs.TH09: (
pgettext_lazy("short game name", "th09"),
pgettext_lazy("standard game name", "Phantasmagoria of Flower View"),
pgettext_lazy("full game name", "東方花映塚 - Phantasmagoria of Flower View"),
pgettext_lazy(
"full game name", "東方花映塚 - Phantasmagoria of Flower View"
),
),
GameIDs.TH10: (
pgettext_lazy("short game name", "th10"),
Expand Down Expand Up @@ -151,7 +157,9 @@ class NameLength(enum.Enum):
GameIDs.TH17: (
pgettext_lazy("short game name", "th17"),
pgettext_lazy("standard game name", "Wily Beast and Weakest Creature"),
pgettext_lazy("full game name", "東方鬼形獣 - Wily Beast and Weakest Creature"),
pgettext_lazy(
"full game name", "東方鬼形獣 - Wily Beast and Weakest Creature"
),
),
GameIDs.TH18: (
pgettext_lazy("short game name", "th18"),
Expand Down
1 change: 0 additions & 1 deletion project/thscoreboard/replays/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Contains all of the models for the replay site."""


import dataclasses
import datetime
from typing import Optional
Expand Down
6 changes: 3 additions & 3 deletions project/thscoreboard/replays/test_rank_replays.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ def _create_n_replays(self, n: int, is_tas: bool = False) -> None:
user=self.user,
score=1_000_000_000 - 100_000_000 * i,
difficulty=0,
category=models.Category.TAS
if is_tas
else models.Category.STANDARD,
category=(
models.Category.TAS if is_tas else models.Category.STANDARD
),
)

def testRanksAgainstAllReplays(self):
Expand Down
1 change: 0 additions & 1 deletion project/thscoreboard/replays/views/edit_replay.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Views related to editing an existing replay."""


from django import urls
from django import shortcuts
from django.template import response as template_response
Expand Down
1 change: 0 additions & 1 deletion project/thscoreboard/replays/views/user.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""The public page for a user's information."""


from django.contrib import auth
from django.shortcuts import get_object_or_404, render
from django.views.decorators import http as http_decorators
Expand Down
18 changes: 9 additions & 9 deletions project/thscoreboard/users/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,22 +164,22 @@ def clean(self):
username=silentselene_username
).exists()
if not silentselene_is_valid:
errors[
"silentselene_username"
] = f"Silentselene user {silentselene_username} does not exist."
errors["silentselene_username"] = (
f"Silentselene user {silentselene_username} does not exist."
)

royalflare_username = cleaned_data["royalflare_username"]
royalflare_replays = Replay.objects.filter(
imported_username__iexact=royalflare_username
)
if not royalflare_replays.exists():
errors[
"royalflare_username"
] = f"No Royalflare replays found for username {royalflare_username}."
errors["royalflare_username"] = (
f"No Royalflare replays found for username {royalflare_username}."
)
elif not royalflare_replays.filter(user__isnull=True).exists():
errors[
"royalflare_username"
] = f"All replays for {royalflare_username} have already been assigned."
errors["royalflare_username"] = (
f"All replays for {royalflare_username} have already been assigned."
)

if len(errors) > 0:
raise forms.ValidationError(errors)
Expand Down
1 change: 1 addition & 0 deletions project/thscoreboard/users/other_views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Defines views for user and account management."""

# TODO: Separate views in different files and put in views/.

from django.http import HttpResponseBadRequest
Expand Down

0 comments on commit 5bf40c9

Please sign in to comment.