Convert Telegram room mentions into pills (ref #62)

This commit is contained in:
Tulir Asokan
2018-02-23 16:45:43 +02:00
parent a26f2c2c36
commit 22e4a189eb
4 changed files with 18 additions and 11 deletions
+4 -1
View File
@@ -311,8 +311,11 @@ class User(AbstractUser):
@classmethod
def find_by_username(cls, username):
if not username:
return None
for _, user in cls.by_tgid.items():
if user.username == username:
if user.username and user.username.lower() == username.lower():
return user
puppet = DBUser.query.filter(DBUser.tg_username == username).one_or_none()