mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Fix mail headers being None (#5873)
* Fix mail headers being None * update tests
This commit is contained in:
committed by
GitHub
parent
cead2898a7
commit
d4460045b4
@@ -321,7 +321,7 @@ def mail(email: Union[str, Sequence[str]], subject: str, template: Union[str, La
|
|||||||
body_plain=body_plain,
|
body_plain=body_plain,
|
||||||
body_html=body_html,
|
body_html=body_html,
|
||||||
sender=sender,
|
sender=sender,
|
||||||
headers=headers,
|
headers=headers or {},
|
||||||
should_attach_tickets=attach_tickets,
|
should_attach_tickets=attach_tickets,
|
||||||
should_attach_ical=attach_ical,
|
should_attach_ical=attach_ical,
|
||||||
should_attach_other_files=attach_other_files or [],
|
should_attach_other_files=attach_other_files or [],
|
||||||
@@ -763,7 +763,7 @@ def mail_send(to: List[str], subject: str, body: str, html: Optional[str], sende
|
|||||||
body_plain=body,
|
body_plain=body,
|
||||||
body_html=html,
|
body_html=html,
|
||||||
sender=sender,
|
sender=sender,
|
||||||
headers=headers,
|
headers=headers or {},
|
||||||
should_attach_tickets=attach_tickets,
|
should_attach_tickets=attach_tickets,
|
||||||
should_attach_ical=attach_ical,
|
should_attach_ical=attach_ical,
|
||||||
should_attach_other_files=attach_other_files or [],
|
should_attach_other_files=attach_other_files or [],
|
||||||
|
|||||||
@@ -170,7 +170,6 @@ def test_queue_state_sent(env):
|
|||||||
subject='Test',
|
subject='Test',
|
||||||
body_plain='Test',
|
body_plain='Test',
|
||||||
sender='sender@example.com',
|
sender='sender@example.com',
|
||||||
headers={},
|
|
||||||
)
|
)
|
||||||
assert m.status == OutgoingMail.STATUS_QUEUED
|
assert m.status == OutgoingMail.STATUS_QUEUED
|
||||||
mail_send_task.apply(kwargs={
|
mail_send_task.apply(kwargs={
|
||||||
@@ -188,7 +187,6 @@ def test_queue_state_permanent_failure(env):
|
|||||||
subject='Test',
|
subject='Test',
|
||||||
body_plain='Test',
|
body_plain='Test',
|
||||||
sender='sender@example.com',
|
sender='sender@example.com',
|
||||||
headers={},
|
|
||||||
)
|
)
|
||||||
assert m.status == OutgoingMail.STATUS_QUEUED
|
assert m.status == OutgoingMail.STATUS_QUEUED
|
||||||
mail_send_task.apply(kwargs={
|
mail_send_task.apply(kwargs={
|
||||||
@@ -210,7 +208,6 @@ def test_queue_state_retry_failure(env, monkeypatch):
|
|||||||
subject='Test',
|
subject='Test',
|
||||||
body_plain='Test',
|
body_plain='Test',
|
||||||
sender='sender@example.com',
|
sender='sender@example.com',
|
||||||
headers={},
|
|
||||||
)
|
)
|
||||||
assert m.status == OutgoingMail.STATUS_QUEUED
|
assert m.status == OutgoingMail.STATUS_QUEUED
|
||||||
mail_send_task.apply(kwargs={
|
mail_send_task.apply(kwargs={
|
||||||
@@ -236,7 +233,6 @@ def test_queue_state_foreign_key_handling():
|
|||||||
subject='Test',
|
subject='Test',
|
||||||
body_plain='Test',
|
body_plain='Test',
|
||||||
sender='sender@example.com',
|
sender='sender@example.com',
|
||||||
headers={},
|
|
||||||
)
|
)
|
||||||
mail_sent = OutgoingMail.objects.create(
|
mail_sent = OutgoingMail.objects.create(
|
||||||
organizer=o,
|
organizer=o,
|
||||||
@@ -245,7 +241,6 @@ def test_queue_state_foreign_key_handling():
|
|||||||
subject='Test',
|
subject='Test',
|
||||||
body_plain='Test',
|
body_plain='Test',
|
||||||
sender='sender@example.com',
|
sender='sender@example.com',
|
||||||
headers={},
|
|
||||||
status=OutgoingMail.STATUS_SENT,
|
status=OutgoingMail.STATUS_SENT,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user