add mailing function

This commit is contained in:
2025-11-14 13:46:20 +03:00
parent 9b9e81c61d
commit 93a425aea9
7 changed files with 122 additions and 0 deletions

View File

@@ -41,6 +41,11 @@ async def update_user(
return user
async def get_users(session: AsyncSession, exclude_admins=False) -> list[User]:
query = select(User).where(User.role == "user") if exclude_admins else select(User)
return await session.scalars(query)
async def get_events_list(session: AsyncSession) -> list[Event]:
result = await session.execute(
select(Event).where(Event.start_date >= datetime.now())