Skip to content

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

Fix failing draftjs to editorjs format migrations (#6569)

Iga Karbowiakbf0781e1c92c
diff --git a/saleor/page/migrations/0015_migrate_from_draftjs_to_editorjs_format.py b/saleor/page/migrations/0015_migrate_from_draftjs_to_editorjs_format.py
index 183da10b4d..1a5603c777 100644
--- a/saleor/page/migrations/0015_migrate_from_draftjs_to_editorjs_format.py
+++ b/saleor/page/migrations/0015_migrate_from_draftjs_to_editorjs_format.py
@@ -24,7 +24,7 @@ def parse_to_editorjs(data):
list_data = {}
for block in blocks:
# if block doesn't have key it means it isn't in draft.js format
- if not block.get("key"):
+ if "key" not in block:
return data
key = block["type"]
inline_style_ranges = block["inlineStyleRanges"]
diff --git a/saleor/product/migrations/0130_migrate_from_draftjs_to_editorjs_format.py b/saleor/product/migrations/0130_migrate_from_draftjs_to_editorjs_format.py
index 8fb43bd669..7e68d1ddb2 100644
--- a/saleor/product/migrations/0130_migrate_from_draftjs_to_editorjs_format.py
+++ b/saleor/product/migrations/0130_migrate_from_draftjs_to_editorjs_format.py
@@ -24,7 +24,7 @@ def parse_to_editorjs(data):
list_data = {}
for block in blocks:
# if block doesn't have key it means it isn't in draft.js format
- if not block.get("key"):
+ if "key" not in block:
return data
key = block["type"]
inline_style_ranges = block["inlineStyleRanges"]