From 407c00addd01429c6332f1b6290fda10702a93b7 Mon Sep 17 00:00:00 2001 From: Igor Mikeshin Date: Fri, 22 Nov 2019 15:06:15 +0800 Subject: [PATCH] Fix ticket search, when there are multiple custom fields --- helpdesk/lib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helpdesk/lib.py b/helpdesk/lib.py index cd3881a5..7269e505 100644 --- a/helpdesk/lib.py +++ b/helpdesk/lib.py @@ -197,7 +197,8 @@ def apply_query(queryset, params): Q(ticketcustomfieldvalue__value__icontains=search) ) - queryset = queryset.filter(qset) + # Distinct works, when there are multiple custom fields + queryset = queryset.filter(qset).distinct() sorting = params.get('sorting', None) if sorting: