Skip to contentSkip to conversation

Allow autobuilder filter string to match anywhere

PATCH New Michael Halstead 1 participant 1 message Nov 7, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow autobuilder filter string to match anywhere

Multiple build clusters use the same prefix so we match a more distinctive string anywhere in the submitter name.

---
 Post/feed.py  | 2 +-
 Post/views.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Post/feed.py +1 -1
index 745ee23..45c5327 100644
@@ -25,7 +25,7 @@ class LatestEntriesFeed(Feed):
         if self.mode == results_mode.SPECIAL_SUBMITTER and hasattr(settings,"SPECIAL_SUBMITTER"):
             #Special submitter mode see settings.py to enable
             name = settings.SPECIAL_SUBMITTER['name']
-            queryset = BuildFailure.objects.order_by('-BUILD__DATE').filter(BUILD__NAME__istartswith=name)[:self.limit]
+            queryset = BuildFailure.objects.order_by('-BUILD__DATE').filter(BUILD__NAME__icontains=name)[:self.limit]
 
         else:
             queryset = BuildFailure.objects.order_by('-BUILD__DATE')[:self.limit]
Post/views.py +1 -1
index 7f2cffb..cabd29b 100644
@@ -205,7 +205,7 @@ def search(request, mode=results_mode.LATEST, **kwargs):
     if mode == results_mode.SPECIAL_SUBMITTER and hasattr(settings,"SPECIAL_SUBMITTER"):
         #Special submitter mode see settings.py to enable
         name = settings.SPECIAL_SUBMITTER['name']
-        items = items.filter(BUILD__NAME__istartswith=name)
+        items = items.filter(BUILD__NAME__icontains=name)
 
     elif mode == results_mode.SEARCH and request.GET.has_key("query"):
         query = request.GET["query"]
Signature · 1 line
2.17.2