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

Commit

Permalink
Merge pull request #297 from GunpreetAhuja/alphanumeric
Browse files Browse the repository at this point in the history
only alphanumeric characters allowed for username
  • Loading branch information
medhach committed May 20, 2017
2 parents 382f5a6 + 7065aa3 commit 2d3bd03
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions signup/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":'<p>Invalid username. Only alphanumeric characters allowed, please Enter again.</p>'}))

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

Expand Down

0 comments on commit 2d3bd03

Please sign in to comment.