This commit is contained in:
winkidney
2019-02-22 17:40:02 +08:00
committed by Ji Qu
parent fb79c2d671
commit 0d60075f28
10 changed files with 22 additions and 19 deletions

View File

@@ -11,10 +11,14 @@ class UserCreationForm(forms.ModelForm):
error_messages = {
'duplicate_username': _("A user with that username already exists."),
}
username = forms.RegexField(label=_("Username"), max_length=30,
regex=r'^[\w-]+$')
password = forms.CharField(label=_("Password"),
widget=forms.PasswordInput)
username = forms.RegexField(
label=_("Username"), max_length=30,
regex=r'^[\w-]+$'
)
password = forms.CharField(
label=_("Password"),
widget=forms.PasswordInput
)
class Meta:
model = User