Skip to content

Commit

Permalink
Unified filtering handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-cukic committed Apr 16, 2015
1 parent 584b28f commit 29714c4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions bugwarrior/services/phab.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,27 @@ def issues(self):
except IndexError:
pass

this_issue_matches = False

if self.shown_user_phids is None and self.shown_project_phids is None:
this_issue_matches = True

if self.shown_user_phids is not None:
# Checking whether authorPHID, ccPHIDs, ownerPHID
# are intersecting with self.shown_user_phids
issue_relevant_to = set(issue['ccPHIDs'] + [issue['ownerPHID'], issue['authorPHID']])
if len(issue_relevant_to.intersection(self.shown_user_phids)) == 0:
continue
if len(issue_relevant_to.intersection(self.shown_user_phids)) > 0:
this_issue_matches = True

if self.shown_project_phids is not None:
# Checking whether projectPHIDs
# is intersecting with self.shown_project_phids
issue_relevant_to = set(issue['projectPHIDs'])
if len(issue_relevant_to.intersection(self.shown_user_phids)) == 0:
continue
if len(issue_relevant_to.intersection(self.shown_user_phids)) > 0:
this_issue_matches = True

if not this_issue_matches:
continue

extra = {
'project': project,
Expand Down

0 comments on commit 29714c4

Please sign in to comment.