Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add initial form value to the paginator urls
Adam Bogdał439b473bb8b4
diff --git a/saleor/dashboard/customer/views.py b/saleor/dashboard/customer/views.pyindex 7a543e0eff..970eacd481 100644--- a/saleor/dashboard/customer/views.py+++ b/saleor/dashboard/customer/views.py@@ -28,6 +28,8 @@ def customer_list(request):customers, paginator = paginate(customers, 30, request.GET.get('page'))ctx = {'customers': customers, 'form': form, 'title': title,'paginator': paginator}+ if not request.GET:+ ctx.update({'default_pagination_params': {'order_status': 'on'}})return TemplateResponse(request, 'dashboard/customer/list.html', ctx)diff --git a/saleor/dashboard/templates/dashboard/customer/list.html b/saleor/dashboard/templates/dashboard/customer/list.htmlindex d680a178a3..64aa0f7cd9 100644--- a/saleor/dashboard/templates/dashboard/customer/list.html+++ b/saleor/dashboard/templates/dashboard/customer/list.html@@ -57,10 +57,14 @@<a href="{% url "dashboard:customer-details" pk=customer.pk %}">{{ customer.email }}</a></td><td>- {{ default_address.first_name }} {{ default_address.last_name }}+ {% if default_address.first_name %}+ {{ default_address.first_name }} {{ default_address.last_name }}+ {% endif %}</td><td>- {{ default_address.city }}, {{ default_address.get_country_display }}+ {% if default_address.city %}+ {{ default_address.city }}, {{ default_address.get_country_display }}+ {% endif %}</td>{% endwith %}<td class="right-align">@@ -69,8 +73,6 @@<td>{% if customer.last_order %}<a href="{% url 'dashboard:order-details' order_pk=customer.last_order %}">#{{ customer.last_order }}</a>- {% else %}- {% trans "N/A" %}{% endif %}</td></tr>diff --git a/saleor/dashboard/templatetags/utils.py b/saleor/dashboard/templatetags/utils.pyindex 51ce3ede48..2370266f53 100644--- a/saleor/dashboard/templatetags/utils.py+++ b/saleor/dashboard/templatetags/utils.py@@ -25,6 +25,7 @@ def construct_get_query(context, **params):all_params = {}all_params.update(request_get)all_params.update(params)+ all_params.update(context.get('default_pagination_params', {}))return '?' + urlencode(all_params)