sklarsa / django-sendgrid-v5

An implementation of Django's EmailBackend compatible with sendgrid-python v5+
MIT License
318 stars 54 forks source link

Personalizations passed as dictionaries cause AssertionErrors #113

Closed alichass closed 1 year ago

alichass commented 1 year ago

Not sure if this is only happening on python 3.10 and above, but the culprit seems to be the type check on line 444 in mail.py: type(personalization) == Dict seems to evaluate to false even when the personalization instances. I believe replacing the check with isinstance(personalization, Dict) should do the trick and leave things backwards compatible. (maybe its worth doing this for line 447 as well?)

Let me know if it would be helpful for me to make the changes and create a PR. Thanks!

sklarsa commented 1 year ago

Thank you for tracking this down! A PR would be fantastic if you have time

sklarsa commented 1 year ago

closed by #114