Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix migration product-0149 (#8323)

Dawid Matuszczyk9ac2dff0a210
diff --git a/saleor/product/migrations/0149_auto_20211004_1636.py b/saleor/product/migrations/0149_auto_20211004_1636.py
index 241caf7040..3c3477619e 100644
--- a/saleor/product/migrations/0149_auto_20211004_1636.py
+++ b/saleor/product/migrations/0149_auto_20211004_1636.py
@@ -22,9 +22,11 @@ def parse_description_json_field(apps, schema):
Category = apps.get_model("product", "Category")
for category in Category.objects.iterator():
- category.description_plaintext = parse_draftjs_content_to_string(
- category.description
- )
+ category.description_plaintext = ""
+ if category.description:
+ category.description_plaintext = parse_draftjs_content_to_string(
+ category.description
+ )
category.save(update_fields=["description_plaintext"])