Allow autobuilder filter string to match anywhere
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.
Signed-off-by Michael Halstead <[email protected]>
--- Post/feed.py | 2 +- Post/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Post/feed.py +1 -1
@@ -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
@@ -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