mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-01-14 18:08:40 +01:00
if files condition restored
This commit is contained in:
parent
fc0ae58420
commit
97b3444a92
@ -119,13 +119,14 @@ def send_templated_mail(template_name,
|
|||||||
sender or settings.DEFAULT_FROM_EMAIL,
|
sender or settings.DEFAULT_FROM_EMAIL,
|
||||||
recipients, bcc=bcc)
|
recipients, bcc=bcc)
|
||||||
msg.attach_alternative(html_part, "text/html")
|
msg.attach_alternative(html_part, "text/html")
|
||||||
|
|
||||||
for filename, filefield in files:
|
if files:
|
||||||
if six.PY3:
|
for filename, filefield in files:
|
||||||
msg.attach_file(filefield.path)
|
if six.PY3:
|
||||||
else:
|
msg.attach_file(filefield.path)
|
||||||
with open(filefield.path, 'rb') as attachedfile:
|
else:
|
||||||
msg.attach(filename, attachedfile.read())
|
with open(filefield.path, 'rb') as attachedfile:
|
||||||
|
msg.attach(filename, attachedfile.read())
|
||||||
|
|
||||||
return msg.send(fail_silently)
|
return msg.send(fail_silently)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user