2025.09.14-18:02:28
This commit is contained in:
19
user/models.py
Normal file
19
user/models.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.conf import settings
|
||||
from .managers import UserProfileManager
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
class UserProfile(AbstractUser):
|
||||
email = models.EmailField(_("email address"),
|
||||
max_length=255,
|
||||
unique=True)
|
||||
username = models.CharField(_("username"),
|
||||
max_length=63,
|
||||
unique=True)
|
||||
USERNAME_FIELD = 'email'
|
||||
REQUIRED_FIELDS = ['username']
|
||||
|
||||
objects = UserProfileManager()
|
||||
|
||||
Reference in New Issue
Block a user