Fix User.get_by_username()

This commit is contained in:
Tulir Asokan
2019-02-12 21:34:19 +02:00
parent 0812c9a3bc
commit e84c793ba6
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -31,8 +31,8 @@ if TYPE_CHECKING:
class Context:
def __init__(self, az: "AppService", db: "scoped_session", config: "Config",
loop: "asyncio.AbstractEventLoop", session_container: "AlchemySessionContainer"
def __init__(self, az: 'AppService', db: 'scoped_session', config: 'Config',
loop: 'asyncio.AbstractEventLoop', session_container: 'AlchemySessionContainer'
) -> None:
self.az = az # type: AppService
self.db = db # type: scoped_session
+1 -1
View File
@@ -58,7 +58,7 @@ class User(Base):
@classmethod
def get_by_username(cls, username: str) -> Optional['User']:
return cls._select_one_or_none(cls.c.username == username)
return cls._select_one_or_none(cls.c.tg_username == username)
@property
def _edit_identity(self):