From b204bc2721bb1b4c1cdc6d3502b37916e4a53772 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Fri, 25 Nov 2016 15:06:33 +0100 Subject: [PATCH] Fix ProductVariation creation when SHOP_USE_VARIATIONS=False --- cartridge/shop/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cartridge/shop/models.py b/cartridge/shop/models.py index ee6e9f40d..30066f9cb 100644 --- a/cartridge/shop/models.py +++ b/cartridge/shop/models.py @@ -139,7 +139,7 @@ def save(self, *args, **kwargs): self.set_content_model() updating = self.id is not None super(Product, self).save(*args, **kwargs) - if updating and not settings.SHOP_USE_VARIATIONS: + if updating and not settings.SHOP_USE_VARIATIONS and self.variations.all(): default = self.variations.get(default=True) self.copy_price_fields_to(default)