]> git.parisson.com Git - telemeta.git/commitdiff
Fix location filter
authormathieu <mathieu.boye28@gmail.com>
Wed, 11 May 2016 12:31:00 +0000 (14:31 +0200)
committermathieu <mathieu.boye28@gmail.com>
Wed, 11 May 2016 12:31:00 +0000 (14:31 +0200)
telemeta/forms/haystack_form.py

index b729cfd188d84f947f417302d1aa962aa5e4c184..5292c1c3123d46deba1748b5eb983b20aebf5042 100644 (file)
@@ -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') != '':