diff options
author | John L. Villalovos <john@sodarock.com> | 2022-01-10 18:11:05 -0800 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2022-01-13 10:31:24 -0800 |
commit | a2e7c383e10509b6eb0fa8760727036feb0807c8 (patch) | |
tree | 934b8e03c90239f1eaa80dcef347e0774ecb589f /gitlab/mixins.py | |
parent | 12435d74364ca881373d690eab89d2e2baa62a49 (diff) | |
download | gitlab-a2e7c383e10509b6eb0fa8760727036feb0807c8.tar.gz |
chore: add EncodedId string class to use to hold URL-encoded paths
Add EncodedId string class. This class returns a URL-encoded string
but ensures it will only URL-encode it once even if recursively
called.
Also added some functional tests of 'lazy' objects to make sure they
work.
Diffstat (limited to 'gitlab/mixins.py')
-rw-r--r-- | gitlab/mixins.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gitlab/mixins.py b/gitlab/mixins.py index 1832247..a6794d0 100644 --- a/gitlab/mixins.py +++ b/gitlab/mixins.py @@ -542,8 +542,7 @@ class SaveMixin(_RestObjectBase): return # call the manager - # Don't use `self.encoded_id` here as `self.manager.update()` will encode it. - obj_id = self.get_id() + obj_id = self.encoded_id if TYPE_CHECKING: assert isinstance(self.manager, UpdateMixin) server_data = self.manager.update(obj_id, updated_data, **kwargs) @@ -573,8 +572,7 @@ class ObjectDeleteMixin(_RestObjectBase): """ if TYPE_CHECKING: assert isinstance(self.manager, DeleteMixin) - # Don't use `self.encoded_id` here as `self.manager.delete()` will encode it. - self.manager.delete(self.get_id(), **kwargs) + self.manager.delete(self.encoded_id, **kwargs) class UserAgentDetailMixin(_RestObjectBase): |