From 54d8152720f38433dcbf86acb1b1ad8d43114a82 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 13 Dec 2018 22:59:12 +0100 Subject: [PATCH 3/4] api: replace unicode by force_text (#28962) --- src/authentic2/api_views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/authentic2/api_views.py b/src/authentic2/api_views.py index e0fbcdbe..8110f14c 100644 --- a/src/authentic2/api_views.py +++ b/src/authentic2/api_views.py @@ -21,6 +21,7 @@ from django.db import models from django.contrib.auth import get_user_model from django.core.exceptions import MultipleObjectsReturned 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.cache import cache_control from django.shortcuts import get_object_or_404 @@ -221,7 +222,7 @@ class Register(BaseRpcView): 'errors': { '__all__': ['Mail sending failed'] }, - 'exception': unicode(e), + 'exception': force_text(e), } response_status = status.HTTP_503_SERVICE_UNAVAILABLE else: -- 2.18.0