From 3170cafce517f4b22dc6fd64961c3f5b083c83cb Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 25 Nov 2019 20:44:13 +1100 Subject: [PATCH] Correct URL for assignees on PRs (#1296) The URL that was used for POST/DELETE when adding and removing assignees was the PR itself, when it should be the issue_url. Fixes #1294 --- github/PullRequest.py | 4 ++-- tests/ReplayData/PullRequest.testAddAndRemoveAssignees.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/github/PullRequest.py b/github/PullRequest.py index 9b13e3b7..23be8e80 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -804,7 +804,7 @@ class PullRequest(github.GithubObject.CompletableGithubObject): post_parameters = {"assignees": [assignee.login if isinstance(assignee, github.NamedUser.NamedUser) else assignee for assignee in assignees]} headers, data = self._requester.requestJsonAndCheck( "POST", - self.url + "/assignees", + self.issue_url + "/assignees", input=post_parameters ) self._useAttributes(data) @@ -819,7 +819,7 @@ class PullRequest(github.GithubObject.CompletableGithubObject): post_parameters = {"assignees": [assignee.login if isinstance(assignee, github.NamedUser.NamedUser) else assignee for assignee in assignees]} headers, data = self._requester.requestJsonAndCheck( "DELETE", - self.url + "/assignees", + self.issue_url + "/assignees", input=post_parameters ) self._useAttributes(data) diff --git a/tests/ReplayData/PullRequest.testAddAndRemoveAssignees.txt b/tests/ReplayData/PullRequest.testAddAndRemoveAssignees.txt index 672c9fb5..fc995787 100644 --- a/tests/ReplayData/PullRequest.testAddAndRemoveAssignees.txt +++ b/tests/ReplayData/PullRequest.testAddAndRemoveAssignees.txt @@ -13,7 +13,7 @@ https POST api.github.com None -/repos/jacquev6/PyGithub/pulls/31/assignees +/repos/jacquev6/PyGithub/issues/31/assignees {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} {"assignees":["jayfk","jzelinskie"]} 201 @@ -24,7 +24,7 @@ https DELETE api.github.com None -/repos/jacquev6/PyGithub/pulls/31/assignees +/repos/jacquev6/PyGithub/issues/31/assignees {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} {"assignees":["jayfk","jzelinskie"]} 200