Updating string format syntax part 1
This commit is contained in:
@ -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()
|
||||
)
|
||||
|
Reference in New Issue
Block a user