2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 15:37:16 +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

@@ -39,13 +39,13 @@ def image_selector(request, path):
base = f"{directory}/"
else:
base = ""
thumbnail_url = reverse('expopage', args=["%st/%s" % (base, f.name)])
thumbnail_url = reverse('expopage', args=[f"{base}t/{f.name}"])
name_base = f.name.rsplit('.', 1)[0]
page_path_base = Path(settings.EXPOWEB) / directory / "l"
if ((page_path_base / ("%s.htm" % name_base)).is_file()):
page_url = reverse('expopage', args=["%sl/%s.htm" % (base, name_base)])
if ((page_path_base / (f"{name_base}.htm")).is_file()):
page_url = reverse('expopage', args=[f"{base}l/{name_base}.htm"])
else:
page_url = reverse('expopage', args=["%s/l/%s.html" % (base, name_base)])
page_url = reverse('expopage', args=[f"{base}/l/{name_base}.html"])
thumbnails.append({"thumbnail_url": thumbnail_url, "page_url": page_url})
@@ -128,7 +128,7 @@ class NewWebImageForm(forms.Form):
def clean_file_(self):
for rel_path, full_path in zip(self.get_rel_paths(), self.get_full_paths()):
if full_path.exists():
raise forms.ValidationError("File already exists in %s" % rel_path)
raise forms.ValidationError(f"File already exists in {rel_path}")
return self.cleaned_data['file_']
class HTMLarea(forms.Textarea):