Skip to content

Commit

Permalink
KeyError /customer/webhooks/whatsapp/message fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalloor, Eric Abraham committed Apr 4, 2023
1 parent 92e15e2 commit c5f1a51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions customer/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ def process_wa_payload(pl):
# API Sent message status update
status = pl['entry'][0]['changes'][0]['value']['statuses'][0]['status']
related_message_id = pl['entry'][0]['changes'][0]['value']['statuses'][0]['id']
if status in ['sent', 'delivered', 'read' 'failed'] and related_message_id:
if status in ('sent', 'delivered', 'read', 'failed') and related_message_id:
WhatsAppMessage.update_status(related_message_id, status,
payload=pl if status == 'failed' else None)
payload=pl if status in ('failed', 'warning') else None)
return 'API Status Update'
except (KeyError):
pass
Expand Down

0 comments on commit c5f1a51

Please sign in to comment.