]> git.openstreetmap.org Git - osqa.git/commitdiff
OSQA-310, during facebook oauth2 registration check whether the length of the user...
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sun, 3 Jul 2011 13:52:44 +0000 (13:52 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sun, 3 Jul 2011 13:52:44 +0000 (13:52 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1101 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum_modules/facebookauth/authentication.py

index cc34fb5efed1bec27dbecaa7e3fb6bff24b54624..aa54c42ece8d9e4e4e7f916c4594e8688ea4435a 100644 (file)
@@ -64,10 +64,16 @@ class FacebookAuthConsumer(AuthenticationConsumer):
         else:
             username = ''
 
+        # Check whether the length if the email is greater than 75, if it is -- just replace the email
+        # with a blank string variable, otherwise we're going to have trouble with the Django model.
+        email = smart_unicode(json['email'])
+        if len(email) > 75:
+            email = ''
+
         # Return the user data.
         return {
             'username': username,
-            'email': smart_unicode(json['email']),
+            'email': email,
         }
 
 class FacebookAuthContext(ConsumerTemplateContext):