diff options
author | Alberto López Martín <alberto.lopez@sidisel.com> | 2019-07-26 14:33:26 +0200 |
---|---|---|
committer | Alberto López Martín <alberto.lopez@sidisel.com> | 2019-07-26 14:33:26 +0200 |
commit | a3d0d7c1e7b259a25d9dc84c0b1de5362c80abb8 (patch) | |
tree | 0f31f72ef6f5307562137c28be25714582ee626b | |
parent | 4a9ef9f0fa26e01fc6c97cf88b2a162e21f61cce (diff) | |
download | gitlab-a3d0d7c1e7b259a25d9dc84c0b1de5362c80abb8.tar.gz |
fix: add project and group label update without id to fix cli
-rw-r--r-- | gitlab/v4/objects.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index eaf57c0..2642a40 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -864,6 +864,17 @@ class GroupLabelManager(ListMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTMa _create_attrs = (("name", "color"), ("description", "priority")) _update_attrs = (("name",), ("new_name", "color", "description", "priority")) + # Update without ID. + def update(self, name, new_data={}, **kwargs): + """Update a Label on the server. + + Args: + name: The name of the label + **kwargs: Extra options to send to the server (e.g. sudo) + """ + new_data["name"] = name + super().update(id=None, new_data=new_data, **kwargs) + # Delete without ID. @exc.on_http_error(exc.GitlabDeleteError) def delete(self, name, **kwargs): @@ -2982,6 +2993,17 @@ class ProjectLabelManager( _create_attrs = (("name", "color"), ("description", "priority")) _update_attrs = (("name",), ("new_name", "color", "description", "priority")) + # Update without ID. + def update(self, name, new_data={}, **kwargs): + """Update a Label on the server. + + Args: + name: The name of the label + **kwargs: Extra options to send to the server (e.g. sudo) + """ + new_data["name"] = name + super().update(id=None, new_data=new_data, **kwargs) + # Delete without ID. @exc.on_http_error(exc.GitlabDeleteError) def delete(self, name, **kwargs): |