api: replace unicode by force_text (#28962)

This commit is contained in:
Benjamin Dauvergne 2018-12-13 22:59:12 +01:00
parent dabfc180a0
commit 7d2840d4a4
1 changed files with 2 additions and 1 deletions

View File

@ -21,6 +21,7 @@ from django.db import models
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model
from django.core.exceptions import MultipleObjectsReturned from django.core.exceptions import MultipleObjectsReturned
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.utils.encoding import force_text
from django.views.decorators.vary import vary_on_headers from django.views.decorators.vary import vary_on_headers
from django.views.decorators.cache import cache_control from django.views.decorators.cache import cache_control
from django.shortcuts import get_object_or_404 from django.shortcuts import get_object_or_404
@ -221,7 +222,7 @@ class Register(BaseRpcView):
'errors': { 'errors': {
'__all__': ['Mail sending failed'] '__all__': ['Mail sending failed']
}, },
'exception': unicode(e), 'exception': force_text(e),
} }
response_status = status.HTTP_503_SERVICE_UNAVAILABLE response_status = status.HTTP_503_SERVICE_UNAVAILABLE
else: else: