-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #699 from troygrosfield/master
Make an abstract verstion of django's UserSocialAuth's model so it can be extended (fixes #698)
- Loading branch information
Showing
2 changed files
with
26 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from django.db import models | ||
|
||
|
||
class UserSocialAuthManager(models.Manager): | ||
"""Manager for the UserSocialAuth django model.""" | ||
|
||
def get_social_auth(self, provider, uid): | ||
try: | ||
return self.select_related('user').get(provider=provider, | ||
uid=uid) | ||
except self.model.DoesNotExist: | ||
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters