From 11e5010b13ef1210c7e05e4b5dafbb43cf3ce58a Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Tue, 9 Jan 2018 15:59:42 +1300 Subject: [PATCH] views: fix classic recipe search redirecting to recipe page with single result 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 --- 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', '')