fix: skip products with blank or non-numeric EAN codes

This commit is contained in:
Malin
2026-03-20 11:35:46 +01:00
parent 162e77c1c3
commit 8d75fcd060

View File

@@ -69,6 +69,11 @@ def download_and_parse():
ean = str(int(ean_raw)) ean = str(int(ean_raw))
else: else:
ean = str(ean_raw).strip() ean = str(ean_raw).strip()
# Skip products with blank or non-numeric EAN codes
if not ean or not ean.isdigit():
continue
brand_raw = row[9] # col J brand_raw = row[9] # col J
brand = str(brand_raw) if brand_raw is not None else "" brand = str(brand_raw) if brand_raw is not None else ""
min_box_raw = row[10] # col K min_box_raw = row[10] # col K