]> git.openstreetmap.org Git - osqa.git/commitdiff
be able to handle Unicode GET params in auth.py properly
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sun, 27 May 2012 12:49:51 +0000 (12:49 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sun, 27 May 2012 12:49:51 +0000 (12:49 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1269 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/views/auth.py

index 3b78eed56daf1d2d8025a3fea3d3d926e47d99e0..9511be91b0616102da9d068e8f09eb1b0bdc2643 100644 (file)
@@ -291,7 +291,7 @@ def send_validation_email(request):
         # We don't care if there are previous cashes in the database... In every case we have to create a new one
         hash = ValidationHash.objects.create_new(request.user, 'email', [request.user.email])
 
-        additional_get_params = urllib.urlencode(request.GET)
+        additional_get_params = urllib.urlencode(dict([k, v.encode('utf-8')] for k, v in request.GET.items()))
         send_template_email([request.user], "auth/mail_validation.html", {
             'validation_code': hash,
             'additional_get_params' : additional_get_params
@@ -409,7 +409,7 @@ def login_and_forward(request, user, forward=None, message=None):
         else:
             return manage_pending_data(request, _('save'), forward)
 
-    additional_get_params = urllib.urlencode(request.GET)
+    additional_get_params = urllib.urlencode(dict([k, v.encode('utf-8')] for k, v in request.GET.items()))
 
     parsed_forward = urlparse(forward)