Allow user change fullname

This commit is contained in:
Zhao-Linux 2022-10-15 23:23:50 +07:00
parent 7fafe394c5
commit 81a490ca93
4 changed files with 302 additions and 285 deletions

View file

@ -3,6 +3,7 @@ from operator import attrgetter
import pyotp
from django import forms
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.forms import AuthenticationForm
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.core.validators import RegexValidator
@ -51,6 +52,12 @@ def fix_unicode(string, unsafe=tuple("\u202a\u202b\u202d\u202e")):
string + (sum(k in unsafe for k in string) - string.count("\u202c")) * "\u202c"
)
class UserForm(ModelForm):
class Meta:
model = User
fields = [
"first_name",
]
class ProfileForm(ModelForm):
if newsletter_id is not None: