Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
fix formatting
AlicjaSzu76c00e1eca7e
diff --git a/saleor/page/views.py b/saleor/page/views.pyindex 9d5e5c8857..13a67d37da 100644--- a/saleor/page/views.py+++ b/saleor/page/views.py@@ -13,5 +13,5 @@ def page_details(request, slug):is_visible = page.publication_date is None or page.publication_date <= todayreturn TemplateResponse(request, "page/details.html", {"page": page, "is_visible": is_visible,- "content_json": json.dumps(page.translated.content_json)}+ "content_json": json.dumps(page.translated.content_json)})diff --git a/saleor/product/views.py b/saleor/product/views.pyindex 7afe9f9c41..c8be2a0304 100644--- a/saleor/product/views.py+++ b/saleor/product/views.py@@ -89,8 +89,9 @@ def product_details(request, slug, product_id, form=None):# show_variant_picker determines if variant picker is used or select inputshow_variant_picker = all([v.attributes for v in product.variants.all()])json_ld_data = product_json_ld(product, product_attributes)+ description_json = product.translated.description_jsonctx = {- "description_json": json.dumps(product.translated.description_json, default=serialize_decimal),+ "description_json": json.dumps(description_json, default=serialize_decimal),"is_visible": is_visible,"form": form,"availability": availability,diff --git a/saleor/static/js/components/description-json.js b/saleor/static/js/components/description-json.jsindex fa850b71d7..69d0b92f7e 100644--- a/saleor/static/js/components/description-json.js+++ b/saleor/static/js/components/description-json.js@@ -1,10 +1,10 @@-import draftToHtml from "draftjs-to-html";+import draftToHtml from 'draftjs-to-html';export default $(document).ready((e) => {const data = 'data-description-json';const description = document.querySelector(`[${data}]`);- if(description) {+ if (description) {const parsed = JSON.parse(description.getAttribute(data));const content = draftToHtml(parsed);description.innerHTML = content;