From 03eb5cda1017f4860e1d338e8fbd7b6630c5ad36 Mon Sep 17 00:00:00 2001 From: mathieu Date: Wed, 11 May 2016 14:31:00 +0200 Subject: [PATCH] Fix location filter --- telemeta/forms/haystack_form.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telemeta/forms/haystack_form.py b/telemeta/forms/haystack_form.py index b729cfd1..5292c1c3 100644 --- a/telemeta/forms/haystack_form.py +++ b/telemeta/forms/haystack_form.py @@ -199,7 +199,7 @@ class HayAdvanceForm(SearchForm): sqs = sqs.filter(code__contains=self.cleaned_data['code']) if self.cleaned_data.get('location'): - sqs = sqs.filter(location_principal__startswith=self.cleaned_data['location']).filter_or(location_relation__startswith=self.cleaned_data['location']) + sqs = sqs.filter(Q(location_principal__startswith=self.cleaned_data['location'])|Q(location_relation__startswith=self.cleaned_data['location'])) if self.cleaned_data['ethnic_group']: if self.cleaned_data.get('ethnic_group') != '': -- 2.39.5