Skip to content

Commit

Permalink
Only mark WA availability on message delivery
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Nov 15, 2023
1 parent 22d9eb4 commit 3433782
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion funnel/views/api/whatsapp_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3433782

Please sign in to comment.