diff options
author | 2023-07-24 10:27:33 +0200 | |
---|---|---|
committer | 2023-07-24 10:27:33 +0200 | |
commit | 08307330510fa2d682f28cb0e7d3769d4f462b63 (patch) | |
tree | a4a089f045f23880eaedb0e14d9050b7b1feb86d /pydis_site | |
parent | Bump ruff from 0.0.278 to 0.0.280 (diff) |
Pleasure the style dictator
Diffstat (limited to 'pydis_site')
-rw-r--r-- | pydis_site/apps/api/tests/test_infractions.py | 4 | ||||
-rw-r--r-- | pydis_site/apps/redirect/urls.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/pydis_site/apps/api/tests/test_infractions.py b/pydis_site/apps/api/tests/test_infractions.py index b9b33ff3..f1e54b1e 100644 --- a/pydis_site/apps/api/tests/test_infractions.py +++ b/pydis_site/apps/api/tests/test_infractions.py @@ -174,14 +174,14 @@ class InfractionTests(AuthenticatedAPITestCase): response = self.client.get(f'{url}?expires_after=gibberish') self.assertEqual(response.status_code, 400) - self.assertEqual(list(response.json())[0], "expires_after") + self.assertEqual(next(iter(response.json())), "expires_after") def test_filter_before_invalid(self): url = reverse('api:bot:infraction-list') response = self.client.get(f'{url}?expires_before=000000000') self.assertEqual(response.status_code, 400) - self.assertEqual(list(response.json())[0], "expires_before") + self.assertEqual(next(iter(response.json())), "expires_before") def test_after_before_before(self): url = reverse('api:bot:infraction-list') diff --git a/pydis_site/apps/redirect/urls.py b/pydis_site/apps/redirect/urls.py index a221ea12..583afa08 100644 --- a/pydis_site/apps/redirect/urls.py +++ b/pydis_site/apps/redirect/urls.py @@ -68,7 +68,7 @@ def map_redirect(name: str, data: Redirect) -> list[URLPattern]: raise ValueError(f"Unknown app in redirect: {new_app_name}") for item in items: - entry = list(item.values())[0] + entry = next(iter(item.values())) # Replace dynamic redirect with concrete path concrete_path = __PARAMETER_REGEX.sub(entry, data.original_path) |