From 3433782b1accfead335a245ae1d5a91bb289d33d Mon Sep 17 00:00:00 2001 From: Kiran Jonnalagadda Date: Wed, 15 Nov 2023 13:39:48 +0530 Subject: [PATCH] Only mark WA availability on message delivery --- funnel/views/api/whatsapp_events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/funnel/views/api/whatsapp_events.py b/funnel/views/api/whatsapp_events.py index 00b1d1109..0a5e1eba0 100644 --- a/funnel/views/api/whatsapp_events.py +++ b/funnel/views/api/whatsapp_events.py @@ -66,11 +66,11 @@ def process_whatsapp_event() -> ReturnView: .get('status') ) - phone_number.mark_has_wa(True) if status == 'sent': phone_number.msg_wa_sent_at = sa.func.utcnow() elif status == 'delivered': phone_number.msg_wa_delivered_at = sa.func.utcnow() + phone_number.mark_has_wa(True) elif status == 'failed': phone_number.msg_wa_failed_at = sa.func.utcnow() db.session.commit()