@@ -184,7 +184,7 @@ async def create_election(
184184 status_code = status .HTTP_400_BAD_REQUEST ,
185185 detail = "cannot use that election name" ,
186186 )
187-
187+
188188 if avaliable_positions is None :
189189 if election_type == "general_election" :
190190 avaliable_positions = elections .tables .DEFAULT_POSITIONS_GENERAL_ELECTION
@@ -222,7 +222,7 @@ async def create_election(
222222 status_code = status .HTTP_400_BAD_REQUEST ,
223223 detail = "would overwrite previous election" ,
224224 )
225-
225+
226226 await elections .crud .create_election (
227227 db_session ,
228228 Election (
@@ -329,7 +329,7 @@ async def delete_election(
329329 await elections .crud .delete_election (db_session , slugified_name )
330330 await db_session .commit ()
331331
332- old_election = await elections .crud .get_election (db_session , slugified_name )
332+ old_election = await elections .crud .get_election (db_session , slugified_name )
333333 return JSONResponse ({"success" : old_election is not None })
334334
335335# registration ------------------------------------------------------------- #
@@ -350,7 +350,7 @@ async def get_election_registrations(
350350 status_code = status .HTTP_401_UNAUTHORIZED ,
351351 detail = "must be logged in to get election registrations"
352352 )
353-
353+
354354 if await elections .crud .get_election (db_session , slugified_name ) is None :
355355 raise HTTPException (
356356 status_code = status .HTTP_404_NOT_FOUND ,
@@ -583,13 +583,11 @@ async def provide_nominee_info(
583583 if discord_username is not None :
584584 updated_data ["discord_username" ] = discord_username
585585 print ("--------Dict data: " , updated_data )
586-
587-
586+
587+
588588 existing_info = await elections .crud .get_nominee_info (db_session , computing_id )
589- print ("-----------existing info" , existing_info )
590589 # if not already existing, create it
591590 if not existing_info :
592- print ("--------------nomineey info" , new_nominee_info )
593591 # check if full name is passed
594592 if "full_name" not in updated_data :
595593 raise HTTPException (
@@ -604,20 +602,20 @@ async def provide_nominee_info(
604602 else :
605603 merged_data = {
606604 "computing_id" : computing_id ,
607- ' full_name' : existing_info .full_name ,
608- ' linked_in' : existing_info .linked_in ,
609- ' instagram' : existing_info .instagram ,
610- ' email' : existing_info .email ,
611- ' discord_username' : existing_info .discord_username ,
605+ " full_name" : existing_info .full_name ,
606+ " linked_in" : existing_info .linked_in ,
607+ " instagram" : existing_info .instagram ,
608+ " email" : existing_info .email ,
609+ " discord_username" : existing_info .discord_username ,
612610 }
613- # update the dictionary with new data
611+ # update the dictionary with new data
614612 merged_data .update (updated_data )
615613 updated_nominee_info = NomineeInfo (** merged_data )
616614 await elections .crud .update_nominee_info (db_session , updated_nominee_info )
617-
615+
618616
619617 await db_session .commit ()
620-
618+
621619
622620 nominee_info = await elections .crud .get_nominee_info (db_session , computing_id )
623621 return JSONResponse (nominee_info .as_serializable ())
0 commit comments