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/mixins.py | |
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/mixins.py')
-rw-r--r-- | gitlab/mixins.py | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/gitlab/mixins.py b/gitlab/mixins.py index 28ad04d..88fea2d 100644 --- a/gitlab/mixins.py +++ b/gitlab/mixins.py @@ -200,10 +200,6 @@ class CreateMixin(object): """ self._check_missing_create_attrs(data) - # special handling of the object if needed - if hasattr(self, '_sanitize_data'): - data = self._sanitize_data(data, 'create') - # We get the attributes that need some special transformation types = getattr(self, '_types', {}) @@ -265,20 +261,14 @@ class UpdateMixin(object): self._check_missing_update_attrs(new_data) - # special handling of the object if needed - if hasattr(self, '_sanitize_data'): - data = self._sanitize_data(new_data, 'update') - else: - data = new_data - # We get the attributes that need some special transformation types = getattr(self, '_types', {}) for attr_name, type_cls in types.items(): - if attr_name in data.keys(): - type_obj = type_cls(data[attr_name]) - data[attr_name] = type_obj.get_for_api() + if attr_name in new_data.keys(): + type_obj = type_cls(new_data[attr_name]) + new_data[attr_name] = type_obj.get_for_api() - return self.gitlab.http_put(path, post_data=data, **kwargs) + return self.gitlab.http_put(path, post_data=new_data, **kwargs) class SetMixin(object): |