diff options
| author | Gauvain Pocentek <gauvain@pocentek.net> | 2018-03-17 19:12:26 +0100 |
|---|---|---|
| committer | Gauvain Pocentek <gauvain@pocentek.net> | 2018-03-17 19:12:26 +0100 |
| commit | 79dc1f17a65364d2d23c2d701118200b2f7cd187 (patch) | |
| tree | 30967a648bfb57329994a68ab63f2505ef7df8f8 /gitlab/v4 | |
| parent | 1940feec3dbb099dc3d671cd14ba756e7d34b071 (diff) | |
| download | gitlab-79dc1f17a65364d2d23c2d701118200b2f7cd187.tar.gz | |
Get rid of _sanitize_data
It was used in one class only, no need for added complexity.
Diffstat (limited to 'gitlab/v4')
| -rw-r--r-- | gitlab/v4/objects.py | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 348775e..956038b 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -388,11 +388,27 @@ class ApplicationSettingsManager(GetWithoutIdMixin, UpdateMixin, RESTManager): 'user_oauth_applications') ) - def _sanitize_data(self, data, action): - new_data = data.copy() + @exc.on_http_error(exc.GitlabUpdateError) + def update(self, id=None, new_data={}, **kwargs): + """Update an object on the server. + + Args: + id: ID of the object to update (can be None if not required) + new_data: the update data for the object + **kwargs: Extra options to send to the Gitlab server (e.g. sudo) + + Returns: + dict: The new object data (*not* a RESTObject) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabUpdateError: If the server cannot perform the request + """ + + data = new_data.copy() if 'domain_whitelist' in data and data['domain_whitelist'] is None: - new_data.pop('domain_whitelist') - return new_data + data.pop('domain_whitelist') + super(ApplicationSettingsManager, self).update(id, data, **kwargs) class BroadcastMessage(SaveMixin, ObjectDeleteMixin, RESTObject): |
