Make sure to test for unicode usernames, since the collate on the username field is latin1
This commit is contained in:
parent
76bef38d71
commit
7b35555776
2 changed files with 12 additions and 0 deletions
|
@ -792,6 +792,12 @@ def get_matching_users(username_prefix, robot_namespace=None,
|
|||
|
||||
|
||||
def verify_user(username_or_email, password):
|
||||
# Make sure we didn't get any unicode for the username.
|
||||
try:
|
||||
str(username_or_email)
|
||||
except ValueError:
|
||||
return None
|
||||
|
||||
try:
|
||||
fetched = User.get((User.username == username_or_email) |
|
||||
(User.email == username_or_email))
|
||||
|
|
Reference in a new issue