Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Collection form template, views
Pacu2514ce8e56621
diff --git a/saleor/dashboard/category/forms.py b/saleor/dashboard/category/forms.pyindex d3817d5a23..a26b830540 100644--- a/saleor/dashboard/category/forms.py+++ b/saleor/dashboard/category/forms.py@@ -5,7 +5,6 @@ from django.utils.translation import pgettext_lazyfrom text_unidecode import unidecodefrom ...product.models import Category-from ..product.widgets import ImagePreviewWidgetclass CategoryForm(forms.ModelForm):diff --git a/saleor/dashboard/collection/forms.py b/saleor/dashboard/collection/forms.pyindex 5c8f64a1a7..6e45229801 100644--- a/saleor/dashboard/collection/forms.py+++ b/saleor/dashboard/collection/forms.py@@ -6,7 +6,6 @@ from text_unidecode import unidecodefrom ...product.models import Collection, Productfrom ..forms import AjaxSelect2MultipleChoiceField-from ..product.widgets import ImagePreviewWidgetclass CollectionForm(forms.ModelForm):diff --git a/saleor/dashboard/collection/views.py b/saleor/dashboard/collection/views.pyindex f886d82371..e0b1b5f4d3 100644--- a/saleor/dashboard/collection/views.py+++ b/saleor/dashboard/collection/views.py@@ -36,7 +36,7 @@ def collection_create(request):form = CollectionForm(request.POST or None, request.FILES or None, instance=collection)if form.is_valid():- collection = form.save()+ form.save()msg = pgettext_lazy('Collection message', 'Added collection')messages.success(request, msg)return redirect('dashboard:collection-list')diff --git a/templates/dashboard/collection/detail.html b/templates/dashboard/collection/detail.htmlindex e745af4746..206a705704 100644--- a/templates/dashboard/collection/detail.html+++ b/templates/dashboard/collection/detail.html@@ -46,7 +46,7 @@<div class="row"><div class="col m12 l9"><div class="card">- <form method="post" id="form-collection" action="" novalidate>+ <form method="post" id="form-collection" enctype="multipart/form-data" novalidate><div class="card-content card-content-form">{% csrf_token %}<div class="row">@@ -60,15 +60,13 @@</div></div><div class="card-action right-align">+ <a href="{% url 'dashboard:collection-list' %}" class="btn btn-flat">+ {% trans "Cancel" context "Collection secondary action" %}</a>{% if collection.pk %}- <a href="{% url 'dashboard:collection-list' %}" class="btn btn-flat">- {% trans "Cancel" context "Collection secondary action" %}</a><button type="submit" class="btn btn-flat primary">{% trans "Update" context "Collection detail action" %}</button>{% else %}- <a href="{% url 'dashboard:collection-list' %}" class="btn btn-flat">- {% trans "Cancel" context "Collection secondary action" %}</a><button type="submit" class="btn btn-flat primary">{% trans "Create" context "Collection detail action" %}</button>