Skip to content

Commit

Permalink
Update user.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntek authored Sep 20, 2017
1 parent 994b71b commit c008d45
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 c008d45

Please sign in to comment.