Wrap result in a list

pull/119/head
stijndcl 2022-07-14 22:03:56 +02:00
parent 84bf1d7a26
commit f0a05c8b4d
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ from database.models import UforaCourse, UforaCourseAlias
async def get_all_courses(session: AsyncSession) -> list[UforaCourse]: async def get_all_courses(session: AsyncSession) -> list[UforaCourse]:
"""Get a list of all courses in the database""" """Get a list of all courses in the database"""
statement = select(UforaCourse) statement = select(UforaCourse)
return (await session.execute(statement)).scalars().all() return list((await session.execute(statement)).scalars().all())
async def get_course_by_name(session: AsyncSession, query: str) -> Optional[UforaCourse]: async def get_course_by_name(session: AsyncSession, query: str) -> Optional[UforaCourse]: