Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add migration to fix variant's attributes' default value
Marcin Gębala83c7b6639f53
diff --git a/saleor/product/migrations/0027_auto_20150625_0319.py b/saleor/product/migrations/0027_auto_20150625_0319.pynew file mode 100644index 0000000000..291e5e1201--- /dev/null+++ b/saleor/product/migrations/0027_auto_20150625_0319.py@@ -0,0 +1,22 @@+# -*- coding: utf-8 -*-+from __future__ import unicode_literals++from django.db import models, migrations+++def clear_attributes(apps, schema_editor):+ Variant = apps.get_model("product", "ProductVariant")+ for variant in Variant.objects.all():+ variant.attributes = {}+ variant.save()+++class Migration(migrations.Migration):++ dependencies = [+ ('product', '0026_auto_20150624_0921'),+ ]++ operations = [+ migrations.RunPython(clear_attributes),+ ]