Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mailgun webhooks: AttributeError 'NoneType' object has no attribute 'get' #361

Closed
izimobil opened this issue Mar 5, 2024 · 1 comment
Closed

Comments

@izimobil
Copy link
Contributor

izimobil commented Mar 5, 2024

In certain cases delivery-status can be None in the event POST data sent to the webhook.
Anymail does not handle this case and throws an AttributeError.

  • Anymail version: 9.1
  • ESP (Mailgun, SendGrid, etc.): mailgun
  • Versions of Django, requests, python:
Django 3.2
Requests 2.31.0
Python 3.11
  • Exact error message and/or stack trace
AttributeError
       at /anymail/mailgun/tracking/
'NoneType' object has no attribute 'get'
  
Request Method: | POST
https://redacted.org/anymail/mailgun/tracking/
3.2
AttributeError
'NoneType' object has no attribute 'get'
/home/redacted/VirtualEnvs/redacted.org/lib/python3.9/site-packages/anymail/webhooks/mailgun.py, line 179, in esp_to_anymail_event
izimobil added a commit to izimobil/django-anymail that referenced this issue Mar 5, 2024
This fixes the case of delivery-status being None in the event data
posted to mailgun webhook handler.
See: anymail#361
izimobil added a commit to izimobil/django-anymail that referenced this issue Mar 5, 2024
- shortened testcase payload to minimum required
- renamed method to be more consistant with existing code
@medmunds
Copy link
Contributor

(Fix released in Anymail 10.3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants