mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-24 02:21:04 +00:00
f string updates
This commit is contained in:
parent
28d40e9914
commit
69b010a8d3
4 changed files with 6 additions and 3 deletions
|
@ -31,6 +31,7 @@ class Announcements(View):
|
||||||
"end_date",
|
"end_date",
|
||||||
"active",
|
"active",
|
||||||
]
|
]
|
||||||
|
# pylint: disable=consider-using-f-string
|
||||||
if sort in sort_fields + ["-{:s}".format(f) for f in sort_fields]:
|
if sort in sort_fields + ["-{:s}".format(f) for f in sort_fields]:
|
||||||
announcements = announcements.order_by(sort)
|
announcements = announcements.order_by(sort)
|
||||||
data = {
|
data = {
|
||||||
|
|
|
@ -28,6 +28,7 @@ class Federation(View):
|
||||||
|
|
||||||
sort = request.GET.get("sort")
|
sort = request.GET.get("sort")
|
||||||
sort_fields = ["created_date", "application_type", "server_name"]
|
sort_fields = ["created_date", "application_type", "server_name"]
|
||||||
|
# pylint: disable=consider-using-f-string
|
||||||
if not sort in sort_fields + ["-{:s}".format(f) for f in sort_fields]:
|
if not sort in sort_fields + ["-{:s}".format(f) for f in sort_fields]:
|
||||||
sort = "-created_date"
|
sort = "-created_date"
|
||||||
servers = servers.order_by(sort)
|
servers = servers.order_by(sort)
|
||||||
|
|
|
@ -41,9 +41,9 @@ def email_preview(request):
|
||||||
"""for development, renders and example email template"""
|
"""for development, renders and example email template"""
|
||||||
template = request.GET.get("email")
|
template = request.GET.get("email")
|
||||||
data = emailing.email_data()
|
data = emailing.email_data()
|
||||||
data["subject_path"] = "email/{}/subject.html".format(template)
|
data["subject_path"] = f"email/{template}/subject.html"
|
||||||
data["html_content_path"] = "email/{}/html_content.html".format(template)
|
data["html_content_path"] = f"email/{template}/html_content.html"
|
||||||
data["text_content_path"] = "email/{}/text_content.html".format(template)
|
data["text_content_path"] = f"email/{template}/text_content.html"
|
||||||
data["reset_link"] = "https://example.com/link"
|
data["reset_link"] = "https://example.com/link"
|
||||||
data["invite_link"] = "https://example.com/link"
|
data["invite_link"] = "https://example.com/link"
|
||||||
data["confirmation_link"] = "https://example.com/link"
|
data["confirmation_link"] = "https://example.com/link"
|
||||||
|
|
|
@ -47,6 +47,7 @@ class UserAdminList(View):
|
||||||
"federated_server__server_name",
|
"federated_server__server_name",
|
||||||
"is_active",
|
"is_active",
|
||||||
]
|
]
|
||||||
|
# pylint: disable=consider-using-f-string
|
||||||
if sort in sort_fields + ["-{:s}".format(f) for f in sort_fields]:
|
if sort in sort_fields + ["-{:s}".format(f) for f in sort_fields]:
|
||||||
users = users.order_by(sort)
|
users = users.order_by(sort)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue