File tree Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 1+ from collections .abc import Sequence
2+
13import sqlalchemy
24from sqlalchemy .ext .asyncio import AsyncSession
35
46from elections .tables import Election , NomineeApplication , NomineeInfo
57from officers .types import OfficerPositionEnum
68
79
8- async def get_all_elections (db_session : AsyncSession ) -> list [Election ]:
9- # TODO: can this return None?
10+ async def get_all_elections (db_session : AsyncSession ) -> Sequence [Election ]:
1011 election_list = (await db_session .scalars (
1112 sqlalchemy
1213 .select (Election )
@@ -55,7 +56,7 @@ async def get_all_registrations_of_user(
5556 db_session : AsyncSession ,
5657 computing_id : str ,
5758 election_slug : str
58- ) -> list [NomineeApplication ] | None :
59+ ) -> Sequence [NomineeApplication ] | None :
5960 registrations = (await db_session .scalars (
6061 sqlalchemy
6162 .select (NomineeApplication )
@@ -86,7 +87,7 @@ async def get_one_registration_in_election(
8687async def get_all_registrations_in_election (
8788 db_session : AsyncSession ,
8889 election_slug : str ,
89- ) -> list [NomineeApplication ] | None :
90+ ) -> Sequence [NomineeApplication ] | None :
9091 registrations = (await db_session .scalars (
9192 sqlalchemy
9293 .select (NomineeApplication )
Original file line number Diff line number Diff line change 1- from datetime import date , datetime
1+ from datetime import datetime
22
33from sqlalchemy import (
44 DateTime ,
77 String ,
88 Text ,
99)
10- from sqlalchemy .ext .hybrid import hybrid_method , hybrid_property
10+ from sqlalchemy .ext .hybrid import hybrid_property
1111from sqlalchemy .orm import Mapped , mapped_column
12- from sqlalchemy .orm .attributes import set_attribute
13- from sqlalchemy .util import hybridproperty
1412
1513from constants import (
1614 COMPUTING_ID_LEN ,
Original file line number Diff line number Diff line change 11import asyncio
2- import json
32from datetime import datetime , timedelta
43
54import pytest
65from httpx import ASGITransport , AsyncClient
76
87from src import load_test_db
9- from src .auth .crud import create_user_session , get_computing_id , update_site_user
8+ from src .auth .crud import create_user_session
109from src .database import SQLALCHEMY_TEST_DATABASE_URL , DatabaseSessionManager
1110from src .elections .crud import (
1211 # election crud
You can’t perform that action at this time.
0 commit comments