2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-16 06:57:12 +00:00

Convert.format() to f-strings with flynt

This commit is contained in:
Philip Sargent
2022-11-23 10:48:39 +00:00
parent 45a640dfe9
commit b06d1dae42
14 changed files with 69 additions and 69 deletions

View File

@@ -219,7 +219,7 @@ def expopage(request, path):
#print(" - EXPOPAGES delivering the file: '{}':{} as MIME type: {}".format(request.path, path,getmimetype(path)),flush=True)
if path.startswith("noinfo") and settings.PUBLIC_SITE and not request.user.is_authenticated:
return HttpResponseRedirect(urljoin(reverse("auth_login"),'?next={}'.format(request.path)))
return HttpResponseRedirect(urljoin(reverse("auth_login"),f'?next={request.path}'))
if path.startswith("admin/"):
# don't even attempt to handle these sorts of mistakes
@@ -354,7 +354,7 @@ def editexpopage(request, path):
postbody = "</html>\n"
body = pageform.cleaned_data["html"]
body = body.replace("\r", "")
result = "%s<head%s>%s</head>%s<body%s>\n%s</body>%s" % (preheader, headerargs, head, postheader, bodyargs, body, postbody)
result = f"{preheader}<head{headerargs}>{head}</head>{postheader}<body{bodyargs}>\n{body}</body>{postbody}"
if not filefound or result != html: # Check if content changed at all
try: