products.py: Verify item exists before removal

This commit is contained in:
Mykola Grymalyuk
2024-07-31 09:05:41 -06:00
parent a074baa2e9
commit 628fe4f8fc
@@ -238,6 +238,7 @@ class CatalogProducts:
if installer["Catalog"] in [SeedType.CustomerSeed, SeedType.DeveloperSeed, SeedType.PublicSeed]: if installer["Catalog"] in [SeedType.CustomerSeed, SeedType.DeveloperSeed, SeedType.PublicSeed]:
for installer_2 in products: for installer_2 in products:
if installer_2["Version"].split(".")[0] == installer["Version"].split(".")[0] and installer_2["Catalog"] not in [SeedType.CustomerSeed, SeedType.DeveloperSeed, SeedType.PublicSeed]: if installer_2["Version"].split(".")[0] == installer["Version"].split(".")[0] and installer_2["Catalog"] not in [SeedType.CustomerSeed, SeedType.DeveloperSeed, SeedType.PublicSeed]:
if installer in products:
products.remove(installer) products.remove(installer)
# Remove EOL versions (older than n-3) # Remove EOL versions (older than n-3)