◐ Shell
clean mode source ↗

Add capability to control GitLab features per project or group by filipowm · Pull Request #1008 · python-gitlab/python-gitlab

Expand Up @@ -724,14 +724,25 @@ class FeatureManager(ListMixin, DeleteMixin, RESTManager): _obj_cls = Feature
@exc.on_http_error(exc.GitlabSetError) def set(self, name, value, feature_group=None, user=None, **kwargs): def set( self, name, value, feature_group=None, user=None, group=None, project=None, **kwargs ): """Create or update the object.
Args: name (str): The value to set for the object value (bool/int): The value to set for the object feature_group (str): A feature group name user (str): A GitLab username group (str): A GitLab group project (str): A GitLab project in form group/project **kwargs: Extra options to send to the server (e.g. sudo)
Raises: Expand All @@ -742,7 +753,14 @@ def set(self, name, value, feature_group=None, user=None, **kwargs): obj: The created/updated attribute """ path = "%s/%s" % (self.path, name.replace("/", "%2F")) data = {"value": value, "feature_group": feature_group, "user": user} data = { "value": value, "feature_group": feature_group, "user": user, "group": group, "project": project, } data = utils.remove_none_from_dict(data)
Comment thread

max-wittig marked this conversation as resolved.

server_data = self.gitlab.http_post(path, post_data=data, **kwargs) return self._obj_cls(self, server_data)
Expand Down