From 130ecb363701b8bfadfb91194f04628f8f243e53 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 07 2016 21:14:34 +0000 Subject: No need to rebuild the search query when searching issues Instead of building a new query, re-use the existing one and adjust it for the new search criteria. --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 0540e8b..a4e4bbc 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -1877,12 +1877,8 @@ def search_issues( ) if search_pattern is not None: - query = session.query( - model.Issue - ).filter( + query = query.filter( model.Issue.title.like('%' + str(search_pattern) + '%') - ).filter( - model.Issue.project_id == repo.id ) query = query.order_by(