Order import: Do not allow importing variation for wrong item (Z#23211320) (#5553)

* Order import: Do not allow importing variation for wrong item (Z#23211320)

* Fix test
This commit is contained in:
Raphael Michel
2025-10-21 09:18:05 +02:00
committed by GitHub
parent 0f25a1d6c8
commit df9147d207
2 changed files with 32 additions and 1 deletions

View File

@@ -175,7 +175,7 @@ class Variation(ImportColumn):
if value:
matches = [
p for p in self.items
if str(p.pk) == value or any((v and v == value) for v in i18n_flat(p.value)) and p.item_id == previous_values['item'].pk
if (str(p.pk) == value or any((v and v == value) for v in i18n_flat(p.value))) and p.item_id == previous_values['item'].pk
]
if len(matches) == 0:
raise ValidationError(_("No matching variation was found."))