]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: fix typo which causes table searches to fail
authorElliot Smith <elliot.smith@intel.com>
Thu, 16 Jun 2016 14:02:00 +0000 (15:02 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 16 Jun 2016 16:37:29 +0000 (17:37 +0100)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/toaster/toastergui/views.py

index 02548761f0433c64491fafdfa6779f82c57e5f5f..28ff67b76f327e8592e9fa86a4067e27d223946b 100755 (executable)
@@ -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