Skip to content

Commit

Permalink
Merge pull request #111 from noahp/noahp/pr-author-filter
Browse files Browse the repository at this point in the history
Add author filter option to pr.all
  • Loading branch information
cosmin authored Dec 23, 2018
2 parents 2dd0582 + f42707c commit 264b252
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stashy/pullrequests.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class PullRequests(ResourceBase, IterableResource):
def __init__(self, url, client, parent):
super(PullRequests, self).__init__(url, client, parent)

def all(self, direction='INCOMING', at=None, state='OPEN', order=None):
def all(self, direction='INCOMING', at=None, state='OPEN', order=None, author=None):
"""
Retrieve pull requests to or from the specified repository.
Expand All @@ -219,6 +219,9 @@ def all(self, direction='INCOMING', at=None, state='OPEN', order=None):
params['state'] = state
if order is not None:
params['order'] = order
if author is not None:
params['role.1'] = 'AUTHOR'
params['username.1'] = author

return self.paginate("", params=params)

Expand Down

0 comments on commit 264b252

Please sign in to comment.