Merge pull request #469 from tmshn/support-multiple-assignees

Support multiple assignees on Issue & PullRequest
This commit is contained in:
Nhomar Hernández [Vauxoo]
2017-01-17 12:53:48 -06:00
committed by GitHub
13 changed files with 128 additions and 16 deletions
+6 -1
View File
@@ -75,6 +75,7 @@ import github.Stargazer
atLeastPython26 = sys.hexversion >= 0x02060000
atLeastPython3 = sys.hexversion >= 0x03000000
class Repository(github.GithubObject.CompletableGithubObject):
"""
This class represents Repositories. The reference can be found here http://developer.github.com/v3/repos/
@@ -864,12 +865,13 @@ class Repository(github.GithubObject.CompletableGithubObject):
)
return github.Hook.Hook(self._requester, headers, data, completed=True)
def create_issue(self, title, body=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, milestone=github.GithubObject.NotSet, labels=github.GithubObject.NotSet):
def create_issue(self, title, body=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, milestone=github.GithubObject.NotSet, labels=github.GithubObject.NotSet, assignees=github.GithubObject.NotSet):
"""
:calls: `POST /repos/:owner/:repo/issues <http://developer.github.com/v3/issues>`_
:param title: string
:param body: string
:param assignee: string or :class:`github.NamedUser.NamedUser`
:param assignees: list (of string or :class:`github.NamedUser.NamedUser`)
:param milestone: :class:`github.Milestone.Milestone`
:param labels: list of :class:`github.Label.Label`
:rtype: :class:`github.Issue.Issue`
@@ -877,6 +879,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
assert isinstance(title, (str, unicode)), title
assert body is github.GithubObject.NotSet or isinstance(body, (str, unicode)), body
assert assignee is github.GithubObject.NotSet or isinstance(assignee, github.NamedUser.NamedUser) or isinstance(assignee, (str, unicode)), assignee
assert assignees is github.GithubObject.NotSet or all(isinstance(element, github.NamedUser.NamedUser) or isinstance(element, (str, unicode)) for element in assignees), assignees
assert milestone is github.GithubObject.NotSet or isinstance(milestone, github.Milestone.Milestone), milestone
assert labels is github.GithubObject.NotSet or all(isinstance(element, github.Label.Label) or isinstance(element, (str, unicode)) for element in labels), labels
@@ -890,6 +893,8 @@ class Repository(github.GithubObject.CompletableGithubObject):
post_parameters["assignee"] = assignee
else:
post_parameters["assignee"] = assignee._identity
if assignees is not github.GithubObject.NotSet:
post_parameters["assignees"] = [element._identity if isinstance(element, github.NamedUser.NamedUser) else element for element in assignees]
if milestone is not github.GithubObject.NotSet:
post_parameters["milestone"] = milestone._identity
if labels is not github.GithubObject.NotSet: