Skip to content

Commit

Permalink
profile query optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
esteban committed Apr 1, 2015
1 parent 7ddea83 commit 33c91ee
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spirit/backends/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,12 @@ def authenticate(self, username=None, password=None, **kwargs):
return user
except (User.DoesNotExist, User.MultipleObjectsReturned):
pass

def get_user(self, user_id):
# This get called if the user get authenticated with email
try:
return User._default_manager\
.select_related('st')\
.get(pk=user_id)
except User.DoesNotExist:
return None

0 comments on commit 33c91ee

Please sign in to comment.