Skip to content

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

Fix confirm_promote

michal3268f429138c
diff --git a/saleor/dashboard/customer/views.py b/saleor/dashboard/customer/views.py
index 9d14dbcd32..a3610db771 100644
--- a/saleor/dashboard/customer/views.py
+++ b/saleor/dashboard/customer/views.py
@@ -52,7 +52,7 @@ def customer_promote_to_staff(request, pk):
'Dashboard message',
'Customer %s promoted to staff member') % customer
messages.success(request, msg)
- return redirect('dashboard:staff-list')
+ return redirect('dashboard:customer-details', pk=customer.pk)
return TemplateResponse(
request, 'dashboard/customer/modal/confirm_promote.html',
{'customer': customer})
diff --git a/templates/dashboard/customer/detail.html b/templates/dashboard/customer/detail.html
index f8e35d4abd..61dc2dadbf 100644
--- a/templates/dashboard/customer/detail.html
+++ b/templates/dashboard/customer/detail.html
@@ -36,7 +36,7 @@
{% block header_extra %}
- {% if customer.pk %}
+ {% if customer.pk and not customer.is_staff and request.user.is_superuser %}
<a class="dropdown-button right" href="#" data-activates="context-menu" data-constrainwidth="false">
<svg data-src="{% static "dashboard/images/more_vert.svg" %}" height="24" width="24" />
</a>
diff --git a/templates/dashboard/customer/modal/confirm_promote.html b/templates/dashboard/customer/modal/confirm_promote.html
index 74056f0105..5205b7341d 100644
--- a/templates/dashboard/customer/modal/confirm_promote.html
+++ b/templates/dashboard/customer/modal/confirm_promote.html
@@ -1,6 +1,6 @@
{% load i18n %}
-<form action="#!" method="post" novalidate>
+<form action="{% url 'dashboard:customer-promote' pk=customer.pk %}" method="post" novalidate>
{% csrf_token %}
<div class="modal-content">
<div class="row">