From 685db8307fe34e0710d132943298ee858cfc825b Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jan 05 2015 10:23:29 +0000 Subject: Add a way to filter for only unassigned tickets by setting the assignee to 0 --- diff --git a/progit/lib.py b/progit/lib.py index 64ad2ba..0e1f3a0 100644 --- a/progit/lib.py +++ b/progit/lib.py @@ -710,11 +710,16 @@ def get_issues( model.TagIssue.tag.in_(tags) ) if assignee is not None: - query = query.filter( - model.Issue.assignee_id == model.User.id - ).filter( - model.User.user == assignee - ) + if assignee not in [0, '0']: + query = query.filter( + model.Issue.assignee_id == model.User.id + ).filter( + model.User.user == assignee + ) + else: + query = query.filter( + model.Issue.assignee_id == None + ) return query.all()