forked from mozilla/django-browserid
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for custom users, update Travis test config, and add docs.
Adds new tests for Django 1.5's new custom user models, and updates the implementation to support them (there's an issue with the original code where it didn't pick up on an updated AUTH_USER_MODEL setting). Updates .travis.yml to test Django 1.3, 1.4, and 1.5. Adds documentation to help users customize django-browserid for their custom user models.
- Loading branch information
Michael Kelly
committed
Nov 7, 2012
1 parent
9ba5897
commit a6b06b5
Showing
6 changed files
with
99 additions
and
9 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
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
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,23 @@ | ||
""" | ||
This Source Code Form is subject to the terms of the Mozilla Public | ||
License, v. 2.0. If a copy of the MPL was not distributed with this | ||
file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
""" | ||
from django.db import models | ||
|
||
try: | ||
from django.contrib.auth.models import AbstractBaseUser | ||
except ImportError: | ||
AbstractBaseUser = object | ||
|
||
|
||
class CustomUser(AbstractBaseUser): | ||
USERNAME_FIELD = 'email' | ||
|
||
email = models.EmailField(unique=True, db_index=True) | ||
|
||
def get_full_name(self): | ||
return self.email | ||
|
||
def get_short_name(self): | ||
return self.email |
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
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
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