diff --git a/eventstore/tasks.py b/eventstore/tasks.py index 19c65aff..11b5f16c 100644 --- a/eventstore/tasks.py +++ b/eventstore/tasks.py @@ -861,8 +861,10 @@ def process_whatsapp_template_send_status(): all_statuses = ready_statuses | expired_statuses for status in all_statuses: + extra = status.data + extra["preferred_channel"] = status.preferred_channel async_create_flow_start.delay( - extra=status.data, + extra=extra, flow=str(status.flow_uuid), contacts=[str(status.contact_uuid)], ) diff --git a/eventstore/tests/test_tasks.py b/eventstore/tests/test_tasks.py index 9a78467b..52e5f122 100644 --- a/eventstore/tests/test_tasks.py +++ b/eventstore/tests/test_tasks.py @@ -987,12 +987,12 @@ def test_starts_flows(self, mock_async_flow_start): mock_async_flow_start.delay.mock_calls, [ mock.call( - extra=self.status_ready.data, + extra={"status": "ready", "preferred_channel": "WhatsApp"}, flow=self.status_ready.flow_uuid, contacts=[self.status_ready.contact_uuid], ), mock.call( - extra=self.status_expired.data, + extra={"status": "expired", "preferred_channel": "WhatsApp"}, flow=self.status_expired.flow_uuid, contacts=[self.status_expired.contact_uuid], ),