Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8077d11

Browse files
committed
Backport create_status from v1.0.0
This fixes a ValidationError caused by defaults in the method:muscle: :computer: :us:
1 parentc076429 commit8077d11

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎github3/repos/repo.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,20 +786,26 @@ def create_release(self, tag_name, target_commitish=None, name=None,
786786
returnRelease(json,self)
787787

788788
@requires_auth
789-
defcreate_status(self,sha,state,target_url='',description='',context=''):
789+
defcreate_status(self,sha,state,target_url=None,description=None,
790+
context='default'):
790791
"""Create a status object on a commit.
791792
792793
:param str sha: (required), SHA of the commit to create the status on
793794
:param str state: (required), state of the test; only the following
794795
are accepted: 'pending', 'success', 'error', 'failure'
795796
:param str target_url: (optional), URL to associate with this status.
796797
:param str description: (optional), short description of the status
798+
:param str context: (optional), A string label to differentiate this
799+
status from the status of other systems
800+
:returns: the status created if successful
801+
:rtype: :class:`~github3.repos.status.Status`
797802
"""
798-
json={}
803+
json=None
799804
ifshaandstate:
800805
data= {'state':state,'target_url':target_url,
801806
'description':description,'context':context}
802807
url=self._build_url('statuses',sha,base_url=self._api)
808+
self._remove_none(data)
803809
json=self._json(self._post(url,data=data),201)
804810
returnStatus(json)ifjsonelseNone
805811

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp