Commit 6ae8ed9c authored by David Seaward's avatar David Seaward

relabel registration fields (partial)

parent 56a14428
from django.utils.translation import ugettext_lazy as _
from registration.forms import RegistrationForm as BaseRegistrationForm
from .models import User
......@@ -11,8 +12,14 @@ class RegistrationForm(BaseRegistrationForm):
model = User
# override base definition to remove email field
fields = [
fields = (
User.USERNAME_FIELD,
'password1',
'password2'
]
'password2',
)
labels = {
User.USERNAME_FIELD: _("Username"),
'password1': _("Passphrase"),
'password2': _("Passphrase confirmation"),
}
......@@ -28,11 +28,12 @@ class UserManager(BaseUserManager):
class User(AbstractUser):
objects = UserManager()
REQUIRED_FIELDS = ['email']
REQUIRED_FIELDS = []
def __init__(self, *args, **kwargs):
return super(User, self).__init__(*args, **kwargs)
user = super(User, self).__init__(*args, **kwargs)
return user
def validate_unique(self, exclude=None):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment