forked from mirrors/bookwyrm
runs black for python formatting
This commit is contained in:
parent
c76ad0a312
commit
da2d146f0b
2 changed files with 4 additions and 3 deletions
|
@ -11,9 +11,9 @@ def email_data():
|
||||||
""" fields every email needs """
|
""" fields every email needs """
|
||||||
site = models.SiteSettings.objects.get()
|
site = models.SiteSettings.objects.get()
|
||||||
if site.logo_small:
|
if site.logo_small:
|
||||||
logo_path = '/images/{}'.format(site.logo_small.url)
|
logo_path = "/images/{}".format(site.logo_small.url)
|
||||||
else:
|
else:
|
||||||
logo_path = '/static/images/logo-small.png'
|
logo_path = "/static/images/logo-small.png"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"site_name": site.name,
|
"site_name": site.name,
|
||||||
|
@ -37,6 +37,7 @@ def password_reset_email(reset_code):
|
||||||
data["user"] = reset_code.user.display_name
|
data["user"] = reset_code.user.display_name
|
||||||
send_email.delay(reset_code.user.email, *format_email("password_reset", data))
|
send_email.delay(reset_code.user.email, *format_email("password_reset", data))
|
||||||
|
|
||||||
|
|
||||||
def format_email(email_name, data):
|
def format_email(email_name, data):
|
||||||
""" render the email templates """
|
""" render the email templates """
|
||||||
subject = (
|
subject = (
|
||||||
|
|
|
@ -39,7 +39,7 @@ class Site(View):
|
||||||
@permission_required("bookwyrm.edit_instance_settings", raise_exception=True)
|
@permission_required("bookwyrm.edit_instance_settings", raise_exception=True)
|
||||||
def email_preview(request):
|
def email_preview(request):
|
||||||
""" for development, renders and example email template """
|
""" for development, renders and example email template """
|
||||||
template = request.GET.get('email')
|
template = request.GET.get("email")
|
||||||
data = emailing.email_data()
|
data = emailing.email_data()
|
||||||
data["subject_path"] = "email/{}/subject.html".format(template)
|
data["subject_path"] = "email/{}/subject.html".format(template)
|
||||||
data["html_content_path"] = "email/{}/html_content.html".format(template)
|
data["html_content_path"] = "email/{}/html_content.html".format(template)
|
||||||
|
|
Loading…
Reference in a new issue