@@ -93,7 +93,7 @@ async def get_election(
9393 all_nominations = await elections .crud .get_all_registrations_in_election (db_session , slugified_name )
9494 election_json ["candidates" ] = []
9595
96- avaliable_positions_list = election .avaliable_positions .split ("," )
96+ avaliable_positions_list = election .available_positions .split ("," )
9797 for nomination in all_nominations :
9898 if nomination .position not in avaliable_positions_list :
9999 # ignore any positions that are **no longer** active
@@ -134,7 +134,7 @@ def _raise_if_bad_election_data(
134134 datetime_start_nominations : datetime ,
135135 datetime_start_voting : datetime ,
136136 datetime_end_voting : datetime ,
137- avaliable_positions : str | None ,
137+ available_positions : str | None ,
138138):
139139 if election_type not in election_types :
140140 raise HTTPException (
@@ -149,8 +149,8 @@ def _raise_if_bad_election_data(
149149 status_code = status .HTTP_400_BAD_REQUEST ,
150150 detail = "dates must be in order from earliest to latest" ,
151151 )
152- elif avaliable_positions is not None :
153- for position in avaliable_positions .split ("," ):
152+ elif available_positions is not None :
153+ for position in available_positions .split ("," ):
154154 if position not in OfficerPosition .position_list ():
155155 raise HTTPException (
156156 status_code = status .HTTP_400_BAD_REQUEST ,
@@ -175,7 +175,7 @@ async def create_election(
175175 datetime_start_voting : datetime ,
176176 datetime_end_voting : datetime ,
177177 # allows None, which assigns it to the default
178- avaliable_positions : str | None = None ,
178+ available_positions : str | None = None ,
179179 survey_link : str | None = None ,
180180):
181181 # ensure that election name is not "list" as it will collide with endpoint
@@ -185,13 +185,13 @@ async def create_election(
185185 detail = "cannot use that election name" ,
186186 )
187187
188- if avaliable_positions is None :
188+ if available_positions is None :
189189 if election_type == "general_election" :
190- avaliable_positions = elections .tables .DEFAULT_POSITIONS_GENERAL_ELECTION
190+ available_positions = elections .tables .DEFAULT_POSITIONS_GENERAL_ELECTION
191191 elif election_type == "by_election" :
192- avaliable_positions = elections .tables .DEFAULT_POSITIONS_BY_ELECTION
192+ available_positions = elections .tables .DEFAULT_POSITIONS_BY_ELECTION
193193 elif election_type == "council_rep_election" :
194- avaliable_positions = elections .tables .DEFAULT_POSITIONS_COUNCIL_REP_ELECTION
194+ available_positions = elections .tables .DEFAULT_POSITIONS_COUNCIL_REP_ELECTION
195195 else :
196196 raise HTTPException (
197197 status_code = status .HTTP_400_BAD_REQUEST ,
@@ -205,7 +205,7 @@ async def create_election(
205205 datetime_start_nominations ,
206206 datetime_start_voting ,
207207 datetime_end_voting ,
208- avaliable_positions ,
208+ available_positions ,
209209 )
210210
211211 is_valid_user , _ , _ = await _validate_user (request , db_session )
@@ -232,7 +232,7 @@ async def create_election(
232232 datetime_start_nominations = datetime_start_nominations ,
233233 datetime_start_voting = datetime_start_voting ,
234234 datetime_end_voting = datetime_end_voting ,
235- avaliable_positions = avaliable_positions ,
235+ available_positions = available_positions ,
236236 survey_link = survey_link
237237 )
238238 )
@@ -260,7 +260,7 @@ async def update_election(
260260 datetime_start_nominations : datetime ,
261261 datetime_start_voting : datetime ,
262262 datetime_end_voting : datetime ,
263- avaliable_positions : str ,
263+ available_positions : str ,
264264 survey_link : str | None = None ,
265265):
266266 slugified_name = _slugify (election_name )
@@ -271,7 +271,7 @@ async def update_election(
271271 datetime_start_nominations ,
272272 datetime_start_voting ,
273273 datetime_end_voting ,
274- avaliable_positions ,
274+ available_positions ,
275275 )
276276
277277 is_valid_user , _ , _ = await _validate_user (request , db_session )
@@ -298,7 +298,7 @@ async def update_election(
298298 datetime_start_nominations = datetime_start_nominations ,
299299 datetime_start_voting = datetime_start_voting ,
300300 datetime_end_voting = datetime_end_voting ,
301- avaliable_positions = avaliable_positions ,
301+ available_positions = available_positions ,
302302 survey_link = survey_link
303303 )
304304 )
@@ -401,7 +401,7 @@ async def register_in_election(
401401 status_code = status .HTTP_404_NOT_FOUND ,
402402 detail = f"election with slug { slugified_name } does not exist"
403403 )
404- elif position not in election .avaliable_positions .split ("," ):
404+ elif position not in election .available_positions .split ("," ):
405405 # NOTE: We only restrict creating a registration for a position that doesn't exist,
406406 # not updating or deleting one
407407 raise HTTPException (
0 commit comments