Skip to content

Commit 516307f

Browse files
committed
fix(project-fork): copy create fix from ProjectPipelineManager
1 parent 44a7c27 commit 516307f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

gitlab/v4/objects.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,6 +2069,25 @@ class ProjectForkManager(CreateMixin, ListMixin, RESTManager):
20692069
)
20702070
_create_attrs = (tuple(), ("namespace",))
20712071

2072+
def create(self, data, **kwargs):
2073+
"""Creates a new object.
2074+
2075+
Args:
2076+
data (dict): Parameters to send to the server to create the
2077+
resource
2078+
**kwargs: Extra options to send to the server (e.g. sudo)
2079+
2080+
Raises:
2081+
GitlabAuthenticationError: If authentication is not correct
2082+
GitlabCreateError: If the server cannot perform the request
2083+
2084+
Returns:
2085+
RESTObject: A new instance of the managed object class build with
2086+
the data sent by the server
2087+
"""
2088+
path = self.path[:-1] # drop the 's'
2089+
return CreateMixin.create(self, data, path=path, **kwargs)
2090+
20722091

20732092
class ProjectHook(SaveMixin, ObjectDeleteMixin, RESTObject):
20742093
_short_print_attr = "url"

0 commit comments

Comments
 (0)