From: mathieu Date: Wed, 11 May 2016 12:31:00 +0000 (+0200) Subject: Fix location filter X-Git-Tag: 1.6.2^2~15^2~3^2~15 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=03eb5cda1017f4860e1d338e8fbd7b6630c5ad36;p=telemeta.git Fix location filter --- 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') != '':