mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 03:41:08 +00:00
Jump from notifications to related PRs/issues. (#1168)
* Jump from notifications to related PRs/issues. * Add test case for jumping to related PRs/issues. Also another method to get notifications scoped to a repository, otherwise it's hard to keep out sensitive information from the test cases.
This commit is contained in:
committed by
Steve Kowalik
parent
b84d9b1928
commit
020fbebcaf
@@ -125,6 +125,20 @@ class Notification(github.GithubObject.CompletableGithubObject):
|
||||
self.url,
|
||||
)
|
||||
|
||||
def get_pull_request(self):
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"GET",
|
||||
self.subject.url
|
||||
)
|
||||
return github.PullRequest.PullRequest(self._requester, headers, data, completed=True)
|
||||
|
||||
def get_issue(self):
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"GET",
|
||||
self.subject.url
|
||||
)
|
||||
return github.Issue.Issue(self._requester, headers, data, completed=True)
|
||||
|
||||
def _initAttributes(self):
|
||||
self._id = github.GithubObject.NotSet
|
||||
self._last_read_at = github.GithubObject.NotSet
|
||||
|
||||
Reference in New Issue
Block a user