fix: handle string EAN codes in Excel (not just integers)
This commit is contained in:
7
main.py
7
main.py
@@ -41,7 +41,12 @@ def download_and_parse():
|
|||||||
if row[1] is None: # col B (index 1) = item_code
|
if row[1] is None: # col B (index 1) = item_code
|
||||||
continue
|
continue
|
||||||
ean_raw = row[3] # col D
|
ean_raw = row[3] # col D
|
||||||
ean = str(int(ean_raw)) if ean_raw is not None else ""
|
if ean_raw is None:
|
||||||
|
ean = ""
|
||||||
|
elif isinstance(ean_raw, (int, float)):
|
||||||
|
ean = str(int(ean_raw))
|
||||||
|
else:
|
||||||
|
ean = str(ean_raw).strip()
|
||||||
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 = row[10] if row[10] is not None else 1 # col K
|
min_box = row[10] if row[10] is not None else 1 # col K
|
||||||
|
|||||||
Reference in New Issue
Block a user