mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Fail silently if attachment could not be found
This commit is contained in:
@@ -176,11 +176,15 @@ def mail_send_task(*args, to: List[str], subject: str, body: str, html: str, sen
|
|||||||
invoices = Invoice.objects.filter(pk__in=invoices)
|
invoices = Invoice.objects.filter(pk__in=invoices)
|
||||||
for inv in invoices:
|
for inv in invoices:
|
||||||
if inv.file:
|
if inv.file:
|
||||||
email.attach(
|
try:
|
||||||
'{}.pdf'.format(inv.number),
|
email.attach(
|
||||||
inv.file.file.read(),
|
'{}.pdf'.format(inv.number),
|
||||||
'application/pdf'
|
inv.file.file.read(),
|
||||||
)
|
'application/pdf'
|
||||||
|
)
|
||||||
|
except:
|
||||||
|
logger.exception('Could not attach invoice to email')
|
||||||
|
pass
|
||||||
if event:
|
if event:
|
||||||
event = Event.objects.get(id=event)
|
event = Event.objects.get(id=event)
|
||||||
backend = event.get_mail_backend()
|
backend = event.get_mail_backend()
|
||||||
|
|||||||
Reference in New Issue
Block a user