Allow user change fullname
This commit is contained in:
parent
7fafe394c5
commit
81a490ca93
4 changed files with 302 additions and 285 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue