Fix User.get_by_username()
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user