Somebody from Singapore reported that he cannot sign up to my website. The website is a Django project and we use django-registration module. The error message says about password field that:
this value may contain only letters, numbers and etc
The user says he is using only latin alphabet in his password, but he has a Chinese keyboard and his system (Windows) is configured for Chinese characters input. I don't know how to reproduce the problem in my development environment.
Does anyone know what could cause this problem? Is django-registration meant to work with non-ASCII characters? The user says he was using only latin characters, so perhaps the problem is that his password was encoded as Unicode, but I'm not really sure about it.
Any help will be much appreciated.
I guess the problem is not with the password, but it is with the user name. See the function UserCreationForm
and UserChangeForm
here
username = forms.RegexField(
label=_("Username"), max_length=30, regex=r"^[\w.@+-]+$",
help_text = _("Required. 30 characters or fewer. Letters, digits and "
"@/./+/-/_ only."),
error_messages = {
'invalid': _("This value may contain only letters, numbers and "
"@/./+/-/_ characters.")})
May be he is using some latin character which is not satisfying this regex.
You may get this error while not matching this regex.