v1k45 / django-notify-x

Notification system for Django
MIT License
187 stars 40 forks source link

Fix ascii decode error when model representation contains unicode data #23

Closed fgmacedo closed 8 years ago

fgmacedo commented 8 years ago

When escaping objects to text, we are using str, but if the obj representation contains invalid ascii caracters, the code breaks:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xea' in position 12: ordinal not in range(128)

This pull request replaces str with the Django's force_text that properly handles unicode.