diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2018-07-01 21:11:46 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2018-07-01 21:11:46 +0200 |
commit | 3365ddd7de2d4a68d38fd3b25eccbd58080c9352 (patch) | |
tree | b8869206a5485d0a2490e95b32bee0e4227e8269 /src | |
parent | Removed a now useless route. (diff) | |
download | newspipe-3365ddd7de2d4a68d38fd3b25eccbd58080c9352.tar.gz newspipe-3365ddd7de2d4a68d38fd3b25eccbd58080c9352.tar.bz2 newspipe-3365ddd7de2d4a68d38fd3b25eccbd58080c9352.zip |
Validate the nickname of the user before account creation.
Diffstat (limited to 'src')
-rw-r--r-- | src/web/forms.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/web/forms.py b/src/web/forms.py index eb571cc8..96953240 100644 --- a/src/web/forms.py +++ b/src/web/forms.py @@ -60,6 +60,11 @@ class SignupForm(Form): if ucontr.read(nickname=self.nickname.data).count(): self.nickname.errors.append('Nickname already taken') validated = False + if self.nickname.data != User.make_valid_nickname(self.nickname.data): + self.nickname.errors.append(lazy_gettext( + 'This nickname has invalid characters. ' + 'Please use letters, numbers, dots and underscores only.')) + validated = False return validated |