From ba4b047dbb83d7e309c9bbc011fbc21084a9c911 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 27 2015 12:46:55 +0000 Subject: Expand the search_issues to be able to find all assigned or not-assigned issues Or, as we already have, all issues assigned to someone --- diff --git a/progit/lib/__init__.py b/progit/lib/__init__.py index fb1afa2..b6b1613 100644 --- a/progit/lib/__init__.py +++ b/progit/lib/__init__.py @@ -710,12 +710,16 @@ def search_issues( model.TagIssue.tag.in_(tags) ) if assignee is not None: - if assignee not in [0, '0']: + if str(assignee).lower() not in ['false', '0', 'true', '1']: query = query.filter( model.Issue.assignee_id == model.User.id ).filter( model.User.user == assignee ) + elif str(assignee).lower() in ['true', '1']: + query = query.filter( + model.Issue.assignee_id != None + ) else: query = query.filter( model.Issue.assignee_id == None