mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fix product import on existing, empty unit_type and variant_unit
This commit is contained in:
@@ -73,11 +73,13 @@ module ProductImport
|
||||
'variant_unit_scale', 'primary_taxon_id')
|
||||
)
|
||||
new_variant.save
|
||||
if entry.attributes['on_demand'].present?
|
||||
new_variant.on_demand = entry.attributes['on_demand']
|
||||
end
|
||||
if entry.attributes['on_hand'].present?
|
||||
new_variant.on_hand = entry.attributes['on_hand']
|
||||
if entry.attributes['unit_type'].present? || entry.attributes['variant_unit_name'].present?
|
||||
if entry.attributes['on_demand'].present?
|
||||
new_variant.on_demand = entry.attributes['on_demand']
|
||||
end
|
||||
if entry.attributes['on_hand'].present?
|
||||
new_variant.on_hand = entry.attributes['on_hand']
|
||||
end
|
||||
end
|
||||
|
||||
new_variant.product_id = product_id
|
||||
|
||||
Reference in New Issue
Block a user