sendgrid-django icon indicating copy to clipboard operation
sendgrid-django copied to clipboard

Lacking compatibility with lazy-translated strings

Open jayhale opened this issue 7 years ago • 0 comments

When preparing the HTTP POST request for sending email via the API, JSON serialization fails when attempting to serialize django.utils.functional.__proxy__ objects (strings that have yet to be translated).

Potential wrap-around fix is to force JSON encoding with an encoder that forces all objects to unicode before attempting to serialize.

Error encountered:

TypeError: Object of type '__proxy__' is not JSON serializable

Source of the issue:

# sgbackend/mail.py line 68, in send_messages:
    self.sg.client.mail.send.post(request_body=mail)

Similar issues: https://github.com/ryanbagwell/django-cms-named-menus/issues/2

jayhale avatar Sep 18 '17 21:09 jayhale