summaryrefslogtreecommitdiffstats
path: root/askbot/deps/django_authopenid/backends.py
diff options
context:
space:
mode:
Diffstat (limited to 'askbot/deps/django_authopenid/backends.py')
-rw-r--r--askbot/deps/django_authopenid/backends.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/askbot/deps/django_authopenid/backends.py b/askbot/deps/django_authopenid/backends.py
index f41427b9..1e8626ac 100644
--- a/askbot/deps/django_authopenid/backends.py
+++ b/askbot/deps/django_authopenid/backends.py
@@ -119,15 +119,17 @@ class AuthBackend(object):
assoc.openid_url = username + '@' + provider_name#has to be this way for external pw logins
elif method == 'openid':
- provider_name = util.get_provider_name(openid_url)
try:
- assoc = UserAssociation.objects.get(
- openid_url = openid_url,
- provider_name = provider_name
- )
+ assoc = UserAssociation.objects.get(openid_url=openid_url)
user = assoc.user
except UserAssociation.DoesNotExist:
return None
+ except UserAssociation.MultipleObjectsReturned:
+ logging.critical(
+ 'duplicate openid url in the database!!! %s' % openid_url
+ )
+ return None
+
elif method == 'email':
#with this method we do no use user association