Skip to content

Commit 72bf410

Browse files
committed
feat: add nominee info model
1 parent e23cc4a commit 72bf410

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/elections/models.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,10 @@ class ElectionModel(BaseModel):
1818
available_positions: str
1919
survey_link: str | None
2020

21+
class NomineeInfoModel(BaseModel):
22+
computing_id: str
23+
full_name: str
24+
linked_in: str
25+
instagram: str
26+
email: str
27+
discord_username: str

src/elections/urls.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
import elections
99
import elections.crud
1010
import elections.tables
11-
from elections.models import ElectionModel
11+
from elections.models import ElectionModel, NomineeInfoModel
1212
from elections.tables import Election, NomineeApplication, NomineeInfo, election_types
1313
from officers.constants import OfficerPosition
1414
from permission.types import ElectionOfficer, WebsiteAdmin
15+
from utils.shared_models import SuccessFailModel
1516
from utils.urls import is_logged_in
1617

1718
router = APIRouter(
@@ -375,7 +376,7 @@ async def get_election_registrations(
375376

376377
@router.post(
377378
"/registration/{election_name:str}",
378-
description="register for a specific position in this election, but doesn't set a speech"
379+
description="register for a specific position in this election, but doesn't set a speech",
379380
)
380381
async def register_in_election(
381382
request: Request,
@@ -552,7 +553,8 @@ async def delete_registration(
552553

553554
@router.get(
554555
"/nominee/info",
555-
description="Nominee info is always publically tied to elections, so be careful!"
556+
description="Nominee info is always publically tied to elections, so be careful!",
557+
response_model=NomineeInfoModel
556558
)
557559
async def get_nominee_info(
558560
request: Request,
@@ -576,7 +578,8 @@ async def get_nominee_info(
576578

577579
@router.put(
578580
"/nominee/info",
579-
description="Will create or update nominee info. Returns an updated copy of their nominee info."
581+
description="Will create or update nominee info. Returns an updated copy of their nominee info.",
582+
response_model=NomineeInfoModel
580583
)
581584
async def provide_nominee_info(
582585
request: Request,

0 commit comments

Comments
 (0)