Files
tinywiki/user/models.py
2025-09-14 18:02:28 +02:00

20 lines
696 B
Python

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()