]> git.parisson.com Git - telemeta.git/commitdiff
Fix backend build_query + fix filtres en ligne/acces compte
authormathieu <mathieu.boye28@gmail.com>
Mon, 2 May 2016 15:22:08 +0000 (17:22 +0200)
committermathieu <mathieu.boye28@gmail.com>
Mon, 2 May 2016 15:22:08 +0000 (17:22 +0200)
telemeta/forms/haystack_form.py
telemeta/util/backend.py

index 777a37a7c142ddb698b80dbc6e2eb5248234728b..de0225590b72598ef76e6300fc0166c3b146c32c 100644 (file)
@@ -226,9 +226,9 @@ class HayAdvanceForm(SearchForm):
 
         if self.cleaned_data['viewable']:
             if self.cleaned_data.get('viewable') == '2':
-                sqs = sqs.filter(digitized=True).filter(Q(item_acces='full') | Q(item_acces='mixed'))
+                sqs = sqs.filter(digitized__exact=True).filter(Q(item_acces='full') | Q(item_acces='mixed'))
             if self.cleaned_data.get('viewable') == '3':
-                sqs = sqs.filter(digitized=True)
+                sqs = sqs.filter(digitized__exact=True)
 
         if self.cleaned_data['item_status']:
             if self.cleaned_data.get('item_status') == 'pub':
index c2f77577450cbe89f9261b22a6d10c35f2ec7faf..e8cbffa3c9180b71b755b004e9ec4494461c9d79 100644 (file)
@@ -26,7 +26,7 @@ import sys
 class CustomElasticSearchQuery(ElasticsearchSearchQuery):
 
     def build_query_fragment(self, field, filter_type, value):
-        value = re.sub(regexSpacePunc, " ", value)
+        value = re.sub(regexSpacePunc, " ", str(value))
         print("Query fragment :"+ field+ ' '+ filter_type+ ' '+ value)
         sys.stdout.flush()
         valeur = super(CustomElasticSearchQuery, self).build_query_fragment(field, filter_type, value)