From b2991cba0bb7140aa2191798a4a469eb3ca72d2b Mon Sep 17 00:00:00 2001 From: Gunpreet Ahuja Date: Mon, 20 Mar 2017 11:32:52 -0400 Subject: [PATCH] Username Validation added Issue #221 --- signup/views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/signup/views.py b/signup/views.py index 12da8a83..167bd78f 100755 --- a/signup/views.py +++ b/signup/views.py @@ -47,6 +47,11 @@ 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('notice.html').render({"pcuser":None, + "text":'

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

',"text1":'

Click here to go to signup page.

',"link":"/signup_page/"})) + password = request.REQUEST['password'] confirmpassword = request.REQUEST['confirmpassword']