diff options
author | Choy Rim <choy.rim@nielsen.com> | 2019-11-20 02:38:42 -0500 |
---|---|---|
committer | Choy Rim <choy.rim@nielsen.com> | 2019-11-20 02:38:42 -0500 |
commit | 516307f1cc9e140c7d85d0ed0c419679b314f80b (patch) | |
tree | e6305bb483a39501c59acfc5f16eff3887d7631b /gitlab/v4/objects.py | |
parent | 44a7c2788dd19c1fe73d7449bd7e1370816fd36d (diff) | |
download | gitlab-516307f1cc9e140c7d85d0ed0c419679b314f80b.tar.gz |
fix(project-fork): copy create fix from ProjectPipelineManager
Diffstat (limited to 'gitlab/v4/objects.py')
-rw-r--r-- | gitlab/v4/objects.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 370bb4c..2b1f955 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -2069,6 +2069,25 @@ class ProjectForkManager(CreateMixin, ListMixin, RESTManager): ) _create_attrs = (tuple(), ("namespace",)) + def create(self, data, **kwargs): + """Creates a new object. + + Args: + data (dict): Parameters to send to the server to create the + resource + **kwargs: Extra options to send to the server (e.g. sudo) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabCreateError: If the server cannot perform the request + + Returns: + RESTObject: A new instance of the managed object class build with + the data sent by the server + """ + path = self.path[:-1] # drop the 's' + return CreateMixin.create(self, data, path=path, **kwargs) + class ProjectHook(SaveMixin, ObjectDeleteMixin, RESTObject): _short_print_attr = "url" |