From dac95dbcb71ba51e7a1ebdf648d571cc0e4cfe26 Mon Sep 17 00:00:00 2001 From: zgeorg Date: Sat, 9 Nov 2024 21:36:05 +0000 Subject: [PATCH] fix for partial match --- app/routers/product_alerts.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/routers/product_alerts.py b/app/routers/product_alerts.py index 617b7fc..5883d28 100644 --- a/app/routers/product_alerts.py +++ b/app/routers/product_alerts.py @@ -170,9 +170,12 @@ def end_of_life_by_hardware( seen_notice_ids = set() for eol in all_eols: bulletin_id = eol.get("url") + # Check if product_id partially matches any entry in affectedProducts if ( - product_id in eol.get("affectedProducts", []) - and bulletin_id not in seen_notice_ids + any( + product_id + in product for product in eol.get("affectedProducts", [])) + and bulletin_id not in seen_notice_ids ): filtered_eols.append(eol) seen_notice_ids.add(bulletin_id)