Fix duplicate aliases being written

This commit is contained in:
polyfloyd 2025-03-23 13:53:01 +01:00
parent 2d250ef008
commit 3f9cb3093c

View file

@ -94,8 +94,8 @@ def update_product_pricings(src):
lines_out.append(line)
continue
human_aliases = sorted(set(product.aliases) - set([prod_info.gtin]) - set(prod_info.aliases))
product.aliases = [prod_info.gtin, *prod_info.aliases, *human_aliases]
aliases = sorted(set(product.aliases) - {prod_info.gtin})
product.aliases = [prod_info.gtin, *aliases]
# Apply profit margin and divide by the number of units per sold packaging.
unit_price = prod_info.price * profit_margin / prod_info.units