Fix incorrectly case sensitive username finding in db. Fixes #384

This commit is contained in:
Tulir Asokan
2019-11-30 15:21:47 +02:00
parent 25d7087d07
commit 91e6a73f33
6 changed files with 15 additions and 9 deletions
+3 -1
View File
@@ -424,8 +424,10 @@ class User(AbstractUser, BaseUser):
if not username:
return None
username = username.lower()
for _, user in cls.by_tgid.items():
if user.username and user.username.lower() == username.lower():
if user.username and user.username.lower() == username:
return user
puppet = DBUser.get_by_username(username)