Repository.create_project() body is optional (#1359)

The POST parameters passed to the create_project API call did not
consider the body optional, and always included it. Fix up a formatting
error in the docstring for good measure.

Fixes #1357
This commit is contained in:
Steve Kowalik
2020-01-19 14:31:58 +10:00
committed by GitHub
parent b11add4193
commit 0e09983dca
+2 -2
View File
@@ -1262,15 +1262,15 @@ class Repository(github.GithubObject.CompletableGithubObject):
def create_project(self, name, body=github.GithubObject.NotSet):
"""
calls: `POST /repos/:owner/:repo/projects <https://developer.github.com/v3/projects/#create-a-repository-project>`_
:calls: `POST /repos/:owner/:repo/projects <https://developer.github.com/v3/projects/#create-a-repository-project>`_
:param name: string
:param body: string
:rtype: :class:`github.Project.Project`
"""
assert isinstance(name, str), name
assert body is github.GithubObject.NotSet or isinstance(body, str), body
post_parameters = {
"name": name,
"body": body,
}
import_header = {"Accept": Consts.mediaTypeProjectsPreview}
if body is not github.GithubObject.NotSet: