Small bugfix in timezone printing

This commit is contained in:
Stijn De Clercq 2023-02-17 01:04:24 +01:00
parent c0adc55be2
commit 1af7e241e2
3 changed files with 12 additions and 3 deletions

View file

@ -47,4 +47,4 @@ async def get_events(session: AsyncSession, *, now: datetime.datetime) -> list[E
async def get_next_event(session: AsyncSession, *, now: datetime.datetime) -> Optional[Event]:
"""Get the first upcoming event"""
statement = select(Event).where(Event.timestamp > now).order_by(Event.timestamp)
return (await session.execute(statement)).scalar_one_or_none()
return (await session.execute(statement)).scalars().first()