fix style app/auth/email.py

This commit is contained in:
Trent Palmer 2025-02-09 17:03:05 -08:00
parent c8d06abbe2
commit 4b67a96f56

View File

@ -8,13 +8,23 @@ from threading import Thread
def send_password_reset_email(contributor, external_url):
token = contributor.get_reset_password_token()
send_email('Photo App Reset Your Password',
send_email(
'Photo App Reset Your Password',
sender=current_app.config['MAIL_ADMINS'][0],
recipients=[contributor.email],
text_body=render_template('email/reset_password_email_text.txt',
contributor=contributor, token=token, external_url=external_url),
html_body=render_template('email/reset_password_email_html.html',
contributor=contributor, token=token, external_url=external_url))
text_body=render_template(
'email/reset_password_email_text.txt',
contributor=contributor,
token=token,
external_url=external_url,
),
html_body=render_template(
'email/reset_password_email_html.html',
contributor=contributor,
token=token,
external_url=external_url,
),
)
def send_async_email(app, msg):
@ -26,4 +36,7 @@ def send_email(subject, sender, recipients, text_body, html_body):
msg = Message(subject, sender=sender, recipients=recipients)
msg.body = text_body
msg.html = html_body
Thread(target=send_async_email, args=(current_app._get_current_object(), msg)).start()
Thread(
target=send_async_email,
args=(current_app._get_current_object(), msg),
).start()