diff --git a/gitlab/mixins.py b/gitlab/mixins.py index c02f4c027..fa426aa8d 100644 --- a/gitlab/mixins.py +++ b/gitlab/mixins.py @@ -527,7 +527,7 @@ def _get_updated_data(self) -> Dict[str, Any]: return updated_data - def save(self, **kwargs: Any) -> None: + def save(self, **kwargs: Any) -> Optional[Dict[str, Any]]: """Save the changes made to the object to the server. The object is updated to match what the server returns. @@ -542,15 +542,18 @@ def save(self, **kwargs: Any) -> None: updated_data = self._get_updated_data() # Nothing to update. Server fails if sent an empty dict. if not updated_data: - return + return None # call the manager obj_id = self.get_id() if TYPE_CHECKING: assert isinstance(self.manager, UpdateMixin) + if isinstance(obj_id, str): + obj_id = utils._url_encode(obj_id) server_data = self.manager.update(obj_id, updated_data, **kwargs) if server_data is not None: self._update_attrs(server_data) + return server_data class ObjectDeleteMixin(_RestObjectBase): diff --git a/tests/functional/api/test_wikis.py b/tests/functional/api/test_wikis.py new file mode 100644 index 000000000..26ac244ec --- /dev/null +++ b/tests/functional/api/test_wikis.py @@ -0,0 +1,15 @@ +""" +GitLab API: +https://docs.gitlab.com/ee/api/wikis.html +""" + + +def test_wikis(project): + + page = project.wikis.create({"title": "title/subtitle", "content": "test content"}) + page.content = "update content" + page.title = "subtitle" + + page.save() + + page.delete() pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy