get all chat users

This commit is contained in:
Igor Lobanov
2022-11-17 00:34:24 +01:00
parent 5704b08d12
commit 3a8f630c6d
3 changed files with 24 additions and 3 deletions

View File

@@ -1,7 +1,6 @@
import asyncio
from sqlalchemy.orm import selectinload
from base.orm import local_session
from orm.user import User
@@ -34,6 +33,11 @@ class UserStorage:
aaa.sort(key=lambda user: user.createdAt)
return aaa
@staticmethod
async def get_all_chat_users():
with local_session() as session:
return session.query(User).where(User.emailConfirmed).all()
@staticmethod
async def get_top_users():
self = UserStorage