Skip to content

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

Do not initialize category field in product details

Marcin Gębalaf5152b0cf4e2
diff --git a/saleor/dashboard/product/forms.py b/saleor/dashboard/product/forms.py
index c7bd23feb9..cec8290f5f 100644
--- a/saleor/dashboard/product/forms.py
+++ b/saleor/dashboard/product/forms.py
@@ -20,8 +20,6 @@ class ProductForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(ProductForm, self).__init__(*args, **kwargs)
- categories = Category.objects.all()
- self.fields['category'].choices = [(c.slug, c.name) for c in categories]
class ShirtForm(ProductForm):
diff --git a/saleor/dashboard/product/views.py b/saleor/dashboard/product/views.py
index 550022b7d4..b42c2ff242 100644
--- a/saleor/dashboard/product/views.py
+++ b/saleor/dashboard/product/views.py
@@ -62,10 +62,6 @@ class ProductView(StaffMemberOnlyMixin, UpdateView):
else:
return super(ProductView, self).get_object(queryset)
- def get_initial(self):
- self.initial.update({'category': self.kwargs.get('category')})
- return self.initial.copy()
-
def get_form_class(self):
if not self.variant_formset:
variant_formset_cls = get_variant_formset(