mirror of
https://github.com/jazzband/django-authority.git
synced 2026-03-21 16:40:30 +00:00
* refs #1: Updated tox + travis. * refs #1; Fixed path to register. * refs #1: Updated urls.py * refs #1: Added username field. Not really sure why it was needed, but whatever. * Added an update note. * refs #2: Updated travis. * refs #2: Updated command to run tests. * refs #2: Added a test showing permission_required is busted. * refs #2: Custom user modal needs a default manager. * refs #2: Updated settings. * refs #2: Stop the exception from being raised. * refs #2: Fixed a problem with named parameters.
20 lines
738 B
Python
20 lines
738 B
Python
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
|
|
from django.contrib.auth.models import UserManager
|
|
from django.db import models
|
|
from django.utils import timezone
|
|
|
|
|
|
class User(AbstractBaseUser, PermissionsMixin):
|
|
USERNAME_FIELD = 'email'
|
|
REQUIRED_FIELDS = ['first_name', 'last_name']
|
|
|
|
username = models.CharField(max_length=100)
|
|
first_name = models.CharField(max_length=50)
|
|
last_name = models.CharField(max_length=50)
|
|
email = models.EmailField(unique=True)
|
|
greeting_message = models.TextField()
|
|
is_staff = models.BooleanField(default=False)
|
|
is_active = models.BooleanField(default=True)
|
|
date_joined = models.DateTimeField(default=timezone.now)
|
|
|
|
objects = UserManager()
|