Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: allow updating of sub-pages in wikis#1080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
kernelport wants to merge1 commit intopython-gitlab:mainfromkernelport:master
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletionsgitlab/mixins.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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.
Expand All@@ -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):
Expand Down
15 changes: 15 additions & 0 deletionstests/functional/api/test_wikis.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
"""
GitLab API:
https://docs.gitlab.com/ee/api/wikis.html
"""


deftest_wikis(project):

page=project.wikis.create({"title":"title/subtitle","content":"test content"})
page.content="update content"
page.title="subtitle"

page.save()

page.delete()

[8]ページ先頭

©2009-2025 Movatter.jp