Fix User.get_by_username()
This commit is contained in:
@@ -31,8 +31,8 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
class Context:
|
class Context:
|
||||||
def __init__(self, az: "AppService", db: "scoped_session", config: "Config",
|
def __init__(self, az: 'AppService', db: 'scoped_session', config: 'Config',
|
||||||
loop: "asyncio.AbstractEventLoop", session_container: "AlchemySessionContainer"
|
loop: 'asyncio.AbstractEventLoop', session_container: 'AlchemySessionContainer'
|
||||||
) -> None:
|
) -> None:
|
||||||
self.az = az # type: AppService
|
self.az = az # type: AppService
|
||||||
self.db = db # type: scoped_session
|
self.db = db # type: scoped_session
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class User(Base):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_by_username(cls, username: str) -> Optional['User']:
|
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
|
@property
|
||||||
def _edit_identity(self):
|
def _edit_identity(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user