mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-05 05:04:46 +02:00
layerindex/views.py: tweak from_email
In production, we use settings.DEFAULT_FROM_EMAIL as our primary source of from_email, rather than settings.SUBMIT_EMAIL_FROM Default to DEFAULT_FROM_EMAIL if it is not Null, fall back to SUBMIT_EMAIL_FROM The real consumer (in production) is a Celery task in layerindex/tasks.py @tasks.task def send_email(subject, text_content, from_email=settings.DEFAULT_FROM_EMAIL, to_emails=[]): Signed-off-by: Tim Orling <tim.orling@konsulko.com>
This commit is contained in:
parent
c4035f018f
commit
6747ed3707
|
@ -1672,7 +1672,7 @@ def email_test_view(request):
|
||||||
'help_contact': _get_help_contact(),
|
'help_contact': _get_help_contact(),
|
||||||
}
|
}
|
||||||
subject = '%s: test email' % site_name
|
subject = '%s: test email' % site_name
|
||||||
from_email = settings.SUBMIT_EMAIL_FROM
|
from_email = settings.DEFAULT_FROM_EMAIL if settings.DEFAULT_FROM_EMAIL else settings.SUBMIT_EMAIL_FROM
|
||||||
to_email = request.user.email
|
to_email = request.user.email
|
||||||
text_content = plaintext.render(d)
|
text_content = plaintext.render(d)
|
||||||
tasks.send_email.apply_async((subject, text_content, from_email, [to_email]))
|
tasks.send_email.apply_async((subject, text_content, from_email, [to_email]))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user