@@ -324,23 +324,20 @@ async def update_term(
324324 raise HTTPException (status_code = 401 , detail = "must have website admin permissions to update another user" )
325325
326326 if (
327- not utils .is_active_term (old_officer_term )
327+ not utils .is_past_term (old_officer_term )
328328 and not await WebsiteAdmin .has_permission (db_session , session_computing_id )
329329 ):
330- raise HTTPException (status_code = 401 , detail = "only website admin can update a non-active term " )
330+ raise HTTPException (status_code = 401 , detail = "only website admins can update past terms " )
331331
332332 # NOTE: Only admins can write new versions of position, start_date, and end_date.
333333 if (
334- (
335- officer_term_upload .position != old_officer_term .position
336- or officer_term_upload .start_date != old_officer_term .start_date
337- or officer_term_upload .end_date != old_officer_term .end_date
338- )
339- and not await WebsiteAdmin .has_permission (db_session , session_computing_id )
340- ):
334+ officer_term_upload .position != old_officer_term .position
335+ or officer_term_upload .start_date != old_officer_term .start_date
336+ or officer_term_upload .end_date != old_officer_term .end_date
337+ ) and not await WebsiteAdmin .has_permission (db_session , session_computing_id ):
341338 raise HTTPException (status_code = 401 , detail = "Non-admins cannot modify position, start_date, or end_date." )
342339
343- # TODO: log all important changes just to a .log file
340+ # TODO: log all important changes to a .log file
344341 success = await officers .crud .update_officer_term (
345342 db_session ,
346343 officer_term_upload .to_officer_term (term_id , old_officer_term .computing_id )
0 commit comments