Updating string format syntax part 1

This commit is contained in:
Mouse Reeve
2021-09-17 21:39:18 -07:00
parent 5196db8cf5
commit 377a4e1ef1
11 changed files with 73 additions and 71 deletions

View File

@ -11,7 +11,7 @@ def email_data():
"""fields every email needs"""
site = models.SiteSettings.objects.get()
if site.logo_small:
logo_path = "/images/{}".format(site.logo_small.url)
logo_path = f"/images/{site.logo_small.url}"
else:
logo_path = "/static/images/logo-small.png"
@ -49,15 +49,15 @@ def password_reset_email(reset_code):
def format_email(email_name, data):
"""render the email templates"""
subject = (
get_template("email/{}/subject.html".format(email_name)).render(data).strip()
get_template(f"email/{email_name}/subject.html").render(data).strip()
)
html_content = (
get_template("email/{}/html_content.html".format(email_name))
get_template(f"email/{email_name}/html_content.html")
.render(data)
.strip()
)
text_content = (
get_template("email/{}/text_content.html".format(email_name))
get_template(f"email/{email_name}/text_content.html")
.render(data)
.strip()
)