Skip to content

Commit 3560546

Browse files
committed
update endpoint logic
1 parent 773d094 commit 3560546

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/elections/urls.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,14 @@ async def update_registration(
474474
status_code=status.HTTP_404_NOT_FOUND,
475475
detail=f"election with slug {slugified_name} does not exist"
476476
)
477-
elif election.status(current_time) != elections.tables.STATUS_NOMINATIONS:
477+
478+
# self updates can only be done during nomination period. Officer updates can be done whenever
479+
elif election.status(current_time) != elections.tables.STATUS_NOMINATIONS and is_self_update:
478480
raise HTTPException(
479481
status_code=status.HTTP_400_BAD_REQUEST,
480482
detail="speeches can only be updated during the nomination period"
481483
)
484+
482485
elif not await elections.crud.get_all_registrations(db_session, ccid_of_registrant, slugified_name):
483486
raise HTTPException(
484487
status_code=status.HTTP_404_NOT_FOUND,

0 commit comments

Comments
 (0)