Skip to content

Commit

Permalink
Auth backends catch now Model.DoesNotExist exceptions instead of all …
Browse files Browse the repository at this point in the history
…of them
  • Loading branch information
flashingpumpkin committed Apr 12, 2010
1 parent 8469bdd commit 0a87f4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions socialregistration/auth.py
@@ -1,7 +1,7 @@
from django.contrib.auth.models import User
from django.contrib.sites.models import Site

from socialregistration.models import (FacebookProfile, TwitterProfile, FriendFeedProfile, OpenIDProfile)
from socialregistration.models import (FacebookProfile, TwitterProfile, OpenIDProfile)

class Auth(object):
def get_user(self, user_id):
Expand All @@ -17,7 +17,7 @@ def authenticate(self, uid=None):
uid=uid,
site=Site.objects.get_current()
).user
except:
except FacebookProfile.DoesNotExist:
return None

class TwitterAuth(Auth):
Expand All @@ -27,7 +27,7 @@ def authenticate(self, twitter_id=None):
twitter_id=twitter_id,
site=Site.objects.get_current()
).user
except:
except TwitterProfile.DoesNotExist:
return None

class OpenIDAuth(Auth):
Expand All @@ -37,5 +37,5 @@ def authenticate(self, identity=None):
identity=identity,
site=Site.objects.get_current()
).user
except:
except OpenIDProfile.DoesNotExist:
return None

0 comments on commit 0a87f4f

Please sign in to comment.