Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

Username Validation added #223

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions signup/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":'<p>Invalid username. Only alphanumeric characters allowed, please Enter again.</p>',"text1":'<p>Click here to go to signup page.</p>',"link":"/signup_page/"}))

password = request.REQUEST['password']
confirmpassword = request.REQUEST['confirmpassword']

Expand Down