@@ -273,15 +273,12 @@ async def _import_configuration(import_data: List[Dict[str, Any]], replace_exist
273273 continue
274274
275275 if existing_mirror and replace_existing :
276- # Delete existing repositories
277276 await SupportedProductsRpmRepomd .filter (supported_products_rh_mirror = existing_mirror ).delete ()
278277 mirror = existing_mirror
279- # Update active field if provided
280278 mirror .active = mirror_data .get ("active" , True )
281279 await mirror .save ()
282280 updated_count += 1
283281 else :
284- # Create new mirror
285282 mirror = SupportedProductsRhMirror (
286283 supported_product = product ,
287284 name = mirror_data ["name" ],
@@ -383,12 +380,10 @@ async def admin_supported_product(request: Request, product_id: int):
383380 if isinstance (product , Response ):
384381 return product
385382
386- # Fetch mirrors with explicit ordering: active first, then by version (desc), then by name
387383 mirrors = await SupportedProductsRhMirror .filter (
388384 supported_product = product
389385 ).order_by ("-active" , "-match_major_version" , "name" ).prefetch_related ("rpm_repomds" ).all ()
390386
391- # Get detailed statistics for each mirror
392387 for mirror in mirrors :
393388 repomds_count = await SupportedProductsRpmRepomd .filter (
394389 supported_products_rh_mirror = mirror
@@ -495,12 +490,10 @@ async def admin_supported_product_mirror_new_post(
495490 if isinstance (product , Response ):
496491 return product
497492
498- # Parse form data to get the active field
499493 form_data_raw = await request .form ()
500494 # Checkbox sends "true" when checked, nothing when unchecked
501495 active_value = "true" if "true" in form_data_raw .getlist ("active" ) else "false"
502496
503- # Validation using centralized validation utility
504497 form_data = {
505498 "name" : name ,
506499 "match_variant" : match_variant ,
@@ -598,12 +591,10 @@ async def admin_supported_product_mirror_post(
598591 if isinstance (mirror , Response ):
599592 return mirror
600593
601- # Parse form data to get the active field
602594 form_data = await request .form ()
603595 # Checkbox sends "true" when checked, nothing when unchecked
604596 active_value = "true" if "true" in form_data .getlist ("active" ) else "false"
605597
606- # Validation using centralized validation utility
607598 try :
608599 validated_name = FieldValidator .validate_name (
609600 name ,
@@ -810,7 +801,6 @@ async def admin_supported_product_mirror_repomd_new_post(
810801 if isinstance (mirror , Response ):
811802 return mirror
812803
813- # Validation using centralized validation utility
814804 form_data = {
815805 "production" : production ,
816806 "arch" : arch ,
@@ -902,7 +892,6 @@ async def admin_supported_product_mirror_repomd_post(
902892 if isinstance (repomd , Response ):
903893 return repomd
904894
905- # Validation using centralized validation utility
906895 form_data = {
907896 "production" : production ,
908897 "arch" : arch ,
0 commit comments