Skip to content

Commit

Permalink
Update user.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntek committed Sep 20, 2017
1 parent 52bb200 commit 994b71b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion user.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def user_register():
session['error_message'] = '该用户名已存在.'
return redirect(url_for('register'))

r = r"^[a-zA-Z][a-zA-Z0-9_-]*$"
r = r"^[a-zA-Z][a-zA-Z0-9_-]+$"
if re.match(r, username) is None:
session['error_message'] = '用户名由字母开头数字和下划线组成.'
return redirect(url_for('register'))
Expand Down

0 comments on commit 994b71b

Please sign in to comment.