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

Commit34c8a03

Browse files
author
Gauvain Pocentek
committed
Make ProjectCommitStatus.create work with CLI
Fixes#511
1 parentf2223e2 commit34c8a03

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

‎gitlab/v4/objects.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,7 @@ class ProjectCommitStatusManager(ListMixin, CreateMixin, RESTManager):
12011201
('description','name','context','ref','target_url',
12021202
'coverage'))
12031203

1204+
@exc.on_http_error(exc.GitlabCreateError)
12041205
defcreate(self,data,**kwargs):
12051206
"""Create a new object.
12061207
@@ -1218,9 +1219,15 @@ def create(self, data, **kwargs):
12181219
RESTObject: A new instance of the manage object class build with
12191220
the data sent by the server
12201221
"""
1221-
path='/projects/%(project_id)s/statuses/%(commit_id)s'
1222-
computed_path=self._compute_path(path)
1223-
returnCreateMixin.create(self,data,path=computed_path,**kwargs)
1222+
# project_id and commit_id are in the data dict when using the CLI, but
1223+
# they are missing when using only the API
1224+
# See #511
1225+
base_path='/projects/%(project_id)s/statuses/%(commit_id)s'
1226+
if'project_id'indataand'commit_id'indata:
1227+
path=base_path%data
1228+
else:
1229+
path=self._compute_path(base_path)
1230+
returnCreateMixin.create(self,data,path=path,**kwargs)
12241231

12251232

12261233
classProjectCommitComment(RESTObject):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp