From 82c28b2b186a8395e479266a3709c1eff9e6e75d Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Fri, 14 Apr 2017 17:17:32 +0200 Subject: [PATCH] Disallow creation of user accounts with @ and _ Mediawiki is just too limiting in which characters it supports, and having to rename users once they eventually want to do things with the wiki is getting out of hand. So we limit the global system to the silliest common denominator, which at this point appears to be mediawiki. --- pgweb/account/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pgweb/account/forms.py b/pgweb/account/forms.py index 117ee599..75297b10 100644 --- a/pgweb/account/forms.py +++ b/pgweb/account/forms.py @@ -55,8 +55,8 @@ class SignupForm(forms.Form): def clean_username(self): username = self.cleaned_data['username'].lower() - if not re.match('^[a-z0-9_@\.-]+$', username): - raise forms.ValidationError("Invalid character in user name. Only a-z, 0-9, _, @, . and - allowed.") + if not re.match('^[a-z0-9\.-]+$', username): + raise forms.ValidationError("Invalid character in user name. Only a-z, 0-9, . and - allowed for compatibility with third party software.") try: User.objects.get(username=username) except User.DoesNotExist: -- 2.39.5