runs black for python formatting

This commit is contained in:
Mouse Reeve 2021-03-21 12:07:58 -07:00
parent c76ad0a312
commit da2d146f0b
2 changed files with 4 additions and 3 deletions

View file

@ -11,9 +11,9 @@ 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 = "/images/{}".format(site.logo_small.url)
else:
logo_path = '/static/images/logo-small.png'
logo_path = "/static/images/logo-small.png"
return {
"site_name": site.name,
@ -37,6 +37,7 @@ def password_reset_email(reset_code):
data["user"] = reset_code.user.display_name
send_email.delay(reset_code.user.email, *format_email("password_reset", data))
def format_email(email_name, data):
""" render the email templates """
subject = (

View file

@ -39,7 +39,7 @@ class Site(View):
@permission_required("bookwyrm.edit_instance_settings", raise_exception=True)
def email_preview(request):
""" for development, renders and example email template """
template = request.GET.get('email')
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)