mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
views: fix "layer:" keyword on recipe search page
We were using the layerbranch id to search for the specified layer, which is most likely to return either no results or results for the wrong layer. We can also avoid specifying the id field at all here as the filter() function can handle real objects. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
8dd24abf99
commit
21f343201d
|
@ -449,11 +449,11 @@ class RecipeSearchView(ListView):
|
|||
messages.add_message(self.request, messages.ERROR, 'The \
|
||||
layer name is expected to follow the \"layer:\" prefix without any spaces.')
|
||||
else:
|
||||
query_layer = LayerBranch.objects.filter(
|
||||
layer__name=query_layername)
|
||||
query_layer = LayerItem.objects.filter(
|
||||
name=query_layername)
|
||||
if query_layer:
|
||||
init_qs = init_qs.filter(
|
||||
layerbranch__layer__id=query_layer[0].id)
|
||||
layerbranch__layer=query_layer[0])
|
||||
else:
|
||||
messages.add_message(self.request, messages.ERROR,
|
||||
'No layer \"%s\" was found.'
|
||||
|
|
Loading…
Reference in New Issue
Block a user