From 8b3726b7d866d614c842ca90593187e726a6cf3e Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Fri, 13 Jan 2012 09:56:32 +0100 Subject: [PATCH] Ensure that names are utf-8 encoded in community auth If the name contains non-ascii characters, we could get an exception when trying to urlencodethe resulting structure. --- pgweb/account/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pgweb/account/views.py b/pgweb/account/views.py index 6e57a87d..2626169f 100644 --- a/pgweb/account/views.py +++ b/pgweb/account/views.py @@ -230,10 +230,10 @@ def communityauth(request, siteid): }, NavContext(request, 'account')) info = { - 'u': request.user.username, - 'f': request.user.first_name, - 'l': request.user.last_name, - 'e': request.user.email, + 'u': request.user.username.encode('utf-8'), + 'f': request.user.first_name.encode('utf-8'), + 'l': request.user.last_name.encode('utf-8'), + 'e': request.user.email.encode('utf-8'), } if su: info['su'] = request.GET['su'] -- 2.39.5