19 lines
667 B
Python
19 lines
667 B
Python
from django.db import models
|
|
from django.contrib.auth.models import AbstractUser
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
|
|
class User(AbstractUser):
|
|
|
|
password = models.CharField(_('password'), max_length=255)
|
|
username = models.CharField(
|
|
_('username'),
|
|
max_length=255,
|
|
unique=True,
|
|
help_text=_('Required. 255 characters or fewer. Letters, digits and @/./+/-/_ only.'),
|
|
validators=[AbstractUser.username_validator],
|
|
error_messages={
|
|
'unique': _("A user with that username already exists."),
|
|
},
|
|
)
|
|
last_name = models.CharField(_('last name'), max_length=150, blank=True)
|