Skip to content

Commit ffdaef6

Browse files
committed
chore: use f-strings
1 parent efc1026 commit ffdaef6

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

weblate_web/payments/backends.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ class DebugPending(DebugPay):
505505
def perform(
506506
self, request: HttpRequest | None, back_url: str, complete_url: str
507507
) -> HttpResponseRedirect | None:
508-
return redirect("https://cihar.com/?url=" + complete_url)
508+
return redirect(f"https://cihar.com/?url={complete_url}")
509509

510510
def collect(self, request: HttpRequest | None) -> bool:
511511
return True

weblate_web/templatetags/site_url.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ def add_site_url(content):
3737
if url is None:
3838
continue
3939
if url.startswith("/"):
40-
link.set("href", "https://weblate.org" + url)
40+
link.set("href", f"https://weblate.org{url}")
4141
for link in tree.findall(".//img"):
4242
url = link.get("src")
4343
if url is None:
4444
continue
4545
if url.startswith("/"):
46-
link.set("src", "https://weblate.org" + url)
46+
link.set("src", f"https://weblate.org{url}")
4747
return mark_safe( # noqa: S308
4848
etree.tostring(
4949
tree.getroot(), pretty_print=True, method="html", encoding="unicode"

weblate_web/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ def test_pending(self) -> None:
10361036
complete_url = reverse("payment-complete", kwargs={"pk": payment.pk})
10371037
self.assertRedirects(
10381038
response,
1039-
"https://cihar.com/?url=http://localhost:1234" + complete_url,
1039+
f"https://cihar.com/?url=http://localhost:1234{complete_url}",
10401040
fetch_redirect_response=False,
10411041
)
10421042
self.check_payment(payment, Payment.PENDING)

weblate_web/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,18 +301,18 @@ def lastmod(self, item):
301301
re_path(
302302
r"^(android-chrome|favicon)-(?P<size>192|512)x(?P=size)\.png$",
303303
RedirectView.as_view(
304-
url=settings.STATIC_URL + "weblate-%(size)s.png", permanent=True
304+
url=f"{settings.STATIC_URL}weblate-%(size)s.png", permanent=True
305305
),
306306
),
307307
path(
308308
"apple-touch-icon.png",
309309
RedirectView.as_view(
310-
url=settings.STATIC_URL + "weblate-180.png", permanent=True
310+
url=f"{settings.STATIC_URL}weblate-180.png", permanent=True
311311
),
312312
),
313313
re_path(
314314
r"^(?P<name>favicon\.ico|robots\.txt)$",
315-
RedirectView.as_view(url=settings.STATIC_URL + "%(name)s", permanent=True),
315+
RedirectView.as_view(url=f"{settings.STATIC_URL}%(name)s", permanent=True),
316316
),
317317
path(
318318
"browserconfig.xml",

0 commit comments

Comments
 (0)