Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Do not show staff members withour orders in customers tab
Anna Siwik7659fc30e53f
diff --git a/saleor/dashboard/customer/views.py b/saleor/dashboard/customer/views.pyindex 213e213c7a..49bc009e9e 100644--- a/saleor/dashboard/customer/views.py+++ b/saleor/dashboard/customer/views.py@@ -1,6 +1,7 @@from django.conf import settingsfrom django.contrib import messagesfrom django.contrib.auth.decorators import permission_required+from django.db.models import Qfrom django.shortcuts import get_object_or_404, redirectfrom django.template.response import TemplateResponsefrom django.utils.translation import pgettext_lazy@@ -18,6 +19,9 @@ from .forms import CustomerFormdef customer_list(request):customers = (User.objects+ .filter(+ Q(is_staff=False) | (Q(is_staff=True) & Q(orders__isnull=False)))+ .distinct().prefetch_related('orders', 'addresses').select_related('default_billing_address', 'default_shipping_address').order_by('email'))