From 7065aa30e42fee4eac5c2423661dac7ad8ecc893 Mon Sep 17 00:00:00 2001 From: GunpreetAhuja Date: Wed, 17 May 2017 13:25:26 -0400 Subject: [PATCH] only alphanumeric characters allowed for username --- signup/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/signup/views.py b/signup/views.py index 1c5b62cc..cbb24dd9 100755 --- a/signup/views.py +++ b/signup/views.py @@ -47,6 +47,12 @@ def signup_do(request): return HttpResponse(jinja_environ.get_template('redirect.html').render({"pcuser":None,"redirect_url":redirect_url})) username = request.REQUEST['username'] + + + if not username.isalnum(): + return HttpResponse(jinja_environ.get_template('signup.html').render({"pcuser":None, + "text":'

Invalid username. Only alphanumeric characters allowed, please Enter again.

'})) + password = request.REQUEST['password'] confirmpassword = request.REQUEST['confirmpassword']