[snowy: 8/26] [django_openid_auth] Don't set username from sreg
- From: Sanford Armstrong <sharm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [snowy: 8/26] [django_openid_auth] Don't set username from sreg
- Date: Tue, 22 Jun 2010 20:57:40 +0000 (UTC)
commit 7b844ab740646cc1dbf696be14c7d34021ad3e14
Author: Leon Handreke <leon handreke gmail com>
Date: Sun Apr 11 21:43:07 2010 +0200
[django_openid_auth] Don't set username from sreg
django may throw errors for some usernames
lib/django_openid_auth/auth.py | 7 ++++++-
settings.py | 1 -
2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/lib/django_openid_auth/auth.py b/lib/django_openid_auth/auth.py
index 047c63a..4cbd402 100644
--- a/lib/django_openid_auth/auth.py
+++ b/lib/django_openid_auth/auth.py
@@ -94,12 +94,17 @@ class OpenIDBackend:
def create_user_from_openid(self, openid_response):
sreg_response = sreg.SRegResponse.fromSuccessResponse(openid_response)
- if sreg_response:
+ # Don't set username from sreg - django doesn't like some characters
+ # Related bug: https://bugs.launchpad.net/django-openid-auth/+bug/388890
+ """if sreg_response:
nickname = sreg_response.get('nickname', 'openiduser')
email = sreg_response.get('email', '')
else:
nickname = 'openiduser'
email = ''
+ """
+ nickname = 'openiduser'
+ email = ''
# Pick a username for the user based on their nickname,
# checking for conflicts.
diff --git a/settings.py b/settings.py
index 8df3c1e..3c6801e 100644
--- a/settings.py
+++ b/settings.py
@@ -145,7 +145,6 @@ ACCOUNT_ACTIVATION_DAYS = 15
AUTH_PROFILE_MODULE = 'accounts.UserProfile'
OPENID_CREATE_USERS = True
-OPENID_UPDATE_DETAILS_FROM_SREG = True
LOGIN_REDIRECT_URL = '/'
LOGIN_URL = '/accounts/openid/login/'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]