mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 12:01:14 +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",
|
||||
"active",
|
||||
]
|
||||
# pylint: disable=consider-using-f-string
|
||||
if sort in sort_fields + ["-{:s}".format(f) for f in sort_fields]:
|
||||
announcements = announcements.order_by(sort)
|
||||
data = {
|
||||
|
|
|
@ -28,6 +28,7 @@ class Federation(View):
|
|||
|
||||
sort = request.GET.get("sort")
|
||||
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]:
|
||||
sort = "-created_date"
|
||||
servers = servers.order_by(sort)
|
||||
|
|
|
@ -41,9 +41,9 @@ def email_preview(request):
|
|||
"""for development, renders and example email template"""
|
||||
template = request.GET.get("email")
|
||||
data = emailing.email_data()
|
||||
data["subject_path"] = "email/{}/subject.html".format(template)
|
||||
data["html_content_path"] = "email/{}/html_content.html".format(template)
|
||||
data["text_content_path"] = "email/{}/text_content.html".format(template)
|
||||
data["subject_path"] = f"email/{template}/subject.html"
|
||||
data["html_content_path"] = f"email/{template}/html_content.html"
|
||||
data["text_content_path"] = f"email/{template}/text_content.html"
|
||||
data["reset_link"] = "https://example.com/link"
|
||||
data["invite_link"] = "https://example.com/link"
|
||||
data["confirmation_link"] = "https://example.com/link"
|
||||
|
|
|
@ -47,6 +47,7 @@ class UserAdminList(View):
|
|||
"federated_server__server_name",
|
||||
"is_active",
|
||||
]
|
||||
# pylint: disable=consider-using-f-string
|
||||
if sort in sort_fields + ["-{:s}".format(f) for f in sort_fields]:
|
||||
users = users.order_by(sort)
|
||||
|
||||
|
|
Loading…
Reference in a new issue