Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Update search after saving a product in dashboard
Artur Smęt509cc91c712f
diff --git a/saleor/dashboard/product/forms.py b/saleor/dashboard/product/forms.pyindex eff44288b2..1c99dc638b 100644--- a/saleor/dashboard/product/forms.py+++ b/saleor/dashboard/product/forms.py@@ -11,6 +11,7 @@ from ...product.models import (AttributeChoiceValue, Product, ProductAttribute,ProductClass, ProductImage, ProductVariant,Stock, StockLocation, VariantImage)from .widgets import ImagePreviewWidget+from ...search import index as search_indexclass ProductClassSelectorForm(forms.Form):@@ -130,7 +131,9 @@ class ProductForm(forms.ModelForm):else:attributes[smart_text(attr.pk)] = valueself.instance.attributes = attributes- return super(ProductForm, self).save(commit=commit)+ instance = super(ProductForm, self).save(commit=commit)+ search_index.insert_or_update_object(instance)+ return instanceclass ProductVariantForm(forms.ModelForm):