Discussion:
[yocto] [error-report-web][PATCH] Allow autobuilder filter string to match anywhere
Michael Halstead
2018-11-07 17:12:11 UTC
Permalink
Multiple build clusters use the same prefix so we match a more distinctive
string anywhere in the submitter name.

Signed-off-by: Michael Halstead <***@linuxfoundation.org>
---
Post/feed.py | 2 +-
Post/views.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Post/feed.py b/Post/feed.py
index 745ee23..45c5327 100644
--- a/Post/feed.py
+++ b/Post/feed.py
@@ -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]
diff --git a/Post/views.py b/Post/views.py
index 7f2cffb..cabd29b 100644
--- a/Post/views.py
+++ b/Post/views.py
@@ -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"]
--
2.17.2

--
Loading...