Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add author filter option to pr.all #111

Merged
merged 1 commit into from
Dec 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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