diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index c319cea..7d7689f 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -1503,6 +1503,7 @@ def get_project(session, name, user=None): def search_issues( session, repo, issueid=None, issueuid=None, status=None, closed=False, tags=None, assignee=None, author=None, private=None, + priority=None, count=False): ''' Retrieve one or more issues associated to a project with the given criterias. @@ -1542,6 +1543,8 @@ def search_issues( If user name is specified: private tickets reported by that user are included. :type private: False, None or str + :kwarg priority: the priority of the issues to search + :type priority: int or None :kwarg count: a boolean to specify if the method should return the list of Issues or just do a COUNT query. :type count: boolean @@ -1575,6 +1578,10 @@ def search_issues( query = query.filter( model.Issue.status != 'Open' ) + if priority: + query = query.filter( + model.Issue.priority == priority + ) if tags is not None and tags != []: if isinstance(tags, basestring): tags = [tags]