Only load users with a tgid at startup

This commit is contained in:
Tulir Asokan
2019-08-06 00:59:11 +03:00
parent d6ebce0425
commit 2a9ab569b4
3 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -41,8 +41,8 @@ class User(Base):
saved_contacts=saved_contacts)
@classmethod
def all(cls) -> Iterable['User']:
return cls._select_all()
def all_with_tgid(cls) -> Iterable['User']:
return cls._select_all(cls.c.tgid != None)
@classmethod
def get_by_tgid(cls, tgid: TelegramID) -> Optional['User']: