All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] toaster: fix typo which causes table searches to fail
@ 2016-06-16 13:48 Elliot Smith
  2016-06-16 14:04 ` Michael Wood
  0 siblings, 1 reply; 3+ messages in thread
From: Elliot Smith @ 2016-06-16 13:48 UTC (permalink / raw)
  To: toaster

The iterator used to create a search query refers to a
variable "x" which isn't set, causing an "'x' is not defined" error
and preventing table searches (on non-ToasterTables) from working.

Use the "field" variable instead, which contains the name of the
field to add to the query.

[YOCTO #9749]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
 bitbake/lib/toaster/toastergui/views.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 0254876..28ff67b 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -324,7 +324,7 @@ def _get_search_results(search_term, queryset, model):
     for st in search_term.split(" "):
         queries = None
         for field in model.search_allowed_fields:
-            query =  Q(**{x+'__icontains': st})
+            query = Q(**{field + '__icontains': st})
             queries = queries | query if queries else query
 
         search_object = search_object & queries if search_object else queries
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH] toaster: fix typo which causes table searches to fail
@ 2016-06-16 14:02 Michael Wood
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Wood @ 2016-06-16 14:02 UTC (permalink / raw)
  To: bitbake-devel

From: Elliot Smith <elliot.smith@intel.com>

The iterator used to create a search query refers to a
variable "x" which isn't set, causing an "'x' is not defined" error
and preventing table searches (on non-ToasterTables) from working.

Use the "field" variable instead, which contains the name of the
field to add to the query.

[YOCTO #9749]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
---
 lib/toaster/toastergui/views.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index 0254876..28ff67b 100755
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -324,7 +324,7 @@ def _get_search_results(search_term, queryset, model):
     for st in search_term.split(" "):
         queries = None
         for field in model.search_allowed_fields:
-            query =  Q(**{x+'__icontains': st})
+            query = Q(**{field + '__icontains': st})
             queries = queries | query if queries else query
 
         search_object = search_object & queries if search_object else queries
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-16 14:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-16 13:48 [PATCH] toaster: fix typo which causes table searches to fail Elliot Smith
2016-06-16 14:04 ` Michael Wood
  -- strict thread matches above, loose matches on Subject: below --
2016-06-16 14:02 Michael Wood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.