@@ -257,11 +257,9 @@ def _resolve_merged_school_type_triple_for_patch(
257257
258258def _require_single_institution_row_by_uuid (sess : Session , inst_id : str ) -> InstTable :
259259 """Load exactly one InstTable row by UUID or raise HTTP 400."""
260- query_result = (
261- sess .execute (
262- select (InstTable ).where (InstTable .id == str_to_uuid (inst_id ))
263- ).all ()
264- )
260+ query_result = sess .execute (
261+ select (InstTable ).where (InstTable .id == str_to_uuid (inst_id ))
262+ ).all ()
265263 if not query_result or len (query_result ) != 1 :
266264 raise HTTPException (
267265 status_code = status .HTTP_400_BAD_REQUEST ,
@@ -300,9 +298,7 @@ def _apply_institution_schema_updates_from_patch(
300298) -> None :
301299 if school_type_changed :
302300 extra_allowed = (
303- update_data ["allowed_schemas" ]
304- if "allowed_schemas" in update_data
305- else None
301+ update_data ["allowed_schemas" ] if "allowed_schemas" in update_data else None
306302 )
307303 existing_inst .schemas = _build_requested_schemas (
308304 extra_allowed ,
@@ -322,12 +318,8 @@ def _patch_indicates_more_than_one_school_type(
322318) -> bool :
323319 """True if merged IDs plus explicit is_edvise/is_legacy flags imply more than one school type."""
324320 pdp_set = bool (pdp_id )
325- edvise_flag = (
326- update_data ["is_edvise" ] if "is_edvise" in update_data else False
327- )
328- legacy_flag = (
329- update_data ["is_legacy" ] if "is_legacy" in update_data else False
330- )
321+ edvise_flag = update_data ["is_edvise" ] if "is_edvise" in update_data else False
322+ legacy_flag = update_data ["is_legacy" ] if "is_legacy" in update_data else False
331323 edvise_set = bool (edvise_id ) or bool (edvise_flag )
332324 legacy_set = bool (legacy_id ) or bool (legacy_flag )
333325 return (pdp_set + edvise_set + legacy_set ) > 1
@@ -391,9 +383,7 @@ def _build_requested_schemas_for_create(
391383 legacy_id : Optional [str ],
392384) -> list :
393385 """Build the requested_schemas list from req and school-type IDs (same rules as PATCH)."""
394- return _build_requested_schemas (
395- req .allowed_schemas , pdp_id , edvise_id , legacy_id
396- )
386+ return _build_requested_schemas (req .allowed_schemas , pdp_id , edvise_id , legacy_id )
397387
398388
399389def _validate_and_prepare_create_institution (
@@ -597,9 +587,7 @@ def update_inst(
597587 final_edvise_id ,
598588 final_legacy_id ,
599589 school_type_changed ,
600- ) = _resolve_merged_school_type_triple_for_patch (
601- existing_inst , update_data , sess
602- )
590+ ) = _resolve_merged_school_type_triple_for_patch (existing_inst , update_data , sess )
603591 _persist_institution_patch_row_fields (
604592 existing_inst ,
605593 update_data ,
0 commit comments