From 8cb8e63db5446b61f03e3f7dac5dab427297c770 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Mon, 21 Jan 2019 16:53:18 -0500 Subject: [PATCH] fix a py3 bug that breaks the SSO complete endpoint --- awx/api/generics.py | 2 +- awx/sso/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/api/generics.py b/awx/api/generics.py index 2bc90373b9..1caadfe567 100644 --- a/awx/api/generics.py +++ b/awx/api/generics.py @@ -90,7 +90,7 @@ class LoggedLoginView(auth_views.LoginView): logger.info(smart_text(u"User {} logged in.".format(self.request.user.username))) ret.set_cookie('userLoggedIn', 'true') current_user = UserSerializer(self.request.user) - current_user = JSONRenderer().render(current_user.data) + current_user = smart_text(JSONRenderer().render(current_user.data)) current_user = urllib.parse.quote('%s' % current_user, '') ret.set_cookie('current_user', current_user, secure=settings.SESSION_COOKIE_SECURE or None) diff --git a/awx/sso/views.py b/awx/sso/views.py index 9a95767825..8de4ae71a5 100644 --- a/awx/sso/views.py +++ b/awx/sso/views.py @@ -44,7 +44,7 @@ class CompleteView(BaseRedirectView): logger.info(smart_text(u"User {} logged in".format(self.request.user.username))) response.set_cookie('userLoggedIn', 'true') current_user = UserSerializer(self.request.user) - current_user = JSONRenderer().render(current_user.data) + current_user = smart_text(JSONRenderer().render(current_user.data)) current_user = urllib.parse.quote('%s' % current_user, '') response.set_cookie('current_user', current_user, secure=settings.SESSION_COOKIE_SECURE or None) return response