s/ean/gtin/

This commit is contained in:
polyfloyd 2024-01-14 13:53:38 +01:00
parent a1cfecc155
commit ef4d1f433f
2 changed files with 4 additions and 4 deletions

View file

@ -58,7 +58,7 @@ def update_product_pricings(src):
product_aliases = set()
if not line.startswith('#'):
product_aliases = set(find_aliases.search(line)['aliases'].split(','))
product_aliases.add(prod_info.ean)
product_aliases.add(prod_info.gtin)
aliases = ','.join(sorted(product_aliases))

View file

@ -6,10 +6,10 @@ import subprocess
class Product:
def __init__(self, name, price, ean, units):
def __init__(self, name, price, gtin, units):
self.name = name
self.price = price
self.ean = ean
self.gtin = gtin
self.units = units
def __str__(self):
@ -38,6 +38,6 @@ def ah_get_by_sku(ah_sku, units):
return Product(
name=schema['name'],
price=Decimal(schema['offers']['price']),
ean=schema['gtin13'],
gtin=schema['gtin13'],
units=units,
)