Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add success url to redirect after bulk delete
Marcin Gębala34da577d4849
diff --git a/saleor/dashboard/product/views.py b/saleor/dashboard/product/views.pyindex 5eef8f8714..9cdbe92898 100644--- a/saleor/dashboard/product/views.py+++ b/saleor/dashboard/product/views.py@@ -65,14 +65,15 @@ def product_details(request, pk=None, product_cls=None):variants_delete_form = VariantsBulkDeleteForm(request.POST, choices=variant_choices)if variants_delete_form.is_valid():variants_delete_form.delete()- return redirect('dashboard:product-update', pk=product.pk)+ success_url = request.POST['success_url']+ return redirect(success_url)if 'stock-bulk-delete-form' in request.POST:stock_delete_form = StockBulkDeleteForm(request.POST, choices=stock_choices)if stock_delete_form.is_valid():stock_delete_form.delete()- return redirect('dashboard:product-update', pk=product.pk)- print stock_delete_form.errors+ success_url = request.POST['success_url']+ return redirect(success_url)ctx = {'attributes': attributes, 'title': title, 'product': product,diff --git a/saleor/dashboard/templates/dashboard/product/product_form.html b/saleor/dashboard/templates/dashboard/product/product_form.htmlindex f490cf846f..41cf98ce7b 100644--- a/saleor/dashboard/templates/dashboard/product/product_form.html+++ b/saleor/dashboard/templates/dashboard/product/product_form.html@@ -170,6 +170,7 @@{% endfor %}</tbody></table>+ <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#variants"></form></div>@@ -223,6 +224,7 @@</tbody>{% endif %}</table>+ <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#stock"></form></div>