Escape special regex character -

This commit is contained in:
Will Stott
2019-07-04 15:18:56 +01:00
committed by GitHub
parent 14d2d5f2f6
commit 941911e709

View File

@@ -13,7 +13,7 @@ class UserCreationForm(forms.ModelForm):
}
username = forms.RegexField(
label=_("Username"), max_length=30,
regex=r'^[\w-.]+$'
regex=r'^[\w\-.]+$'
)
password = forms.CharField(
label=_("Password"),