[yocto] [layerindex-web][PATCH 6/6] views: fix classic recipe search redirecting to recipe page with single result

Paul Eggleton paul.eggleton at linux.intel.com
Mon Jan 8 20:20:29 PST 2018


If your classic recipe search returned a single result, then since
commit c8c25fb641c500354cf36c3c59abb6f9fe96d223 you got a standard
recipe page instead of the proper page with fields you can edit. To fix
it, just drop the redirection functionality from the classic recipe
search, since we don't really want it here.

Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
---
 layerindex/views.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/layerindex/views.py b/layerindex/views.py
index 84de4e0..4f6c2c9 100644
--- a/layerindex/views.py
+++ b/layerindex/views.py
@@ -865,6 +865,10 @@ class RecipeDetailView(DetailView):
 
 
 class ClassicRecipeSearchView(RecipeSearchView):
+    def render_to_response(self, context, **kwargs):
+        # Bypass the redirect-to-single-instance behaviour of RecipeSearchView
+        return super(ListView, self).render_to_response(context, **kwargs)
+
     def get_queryset(self):
         self.kwargs['branch'] = 'oe-classic'
         query_string = self.request.GET.get('q', '')
-- 
2.9.5




More information about the yocto mailing list