File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -527,7 +527,7 @@ def _get_updated_data(self) -> Dict[str, Any]:
527
527
528
528
return updated_data
529
529
530
- def save (self , ** kwargs : Any ) -> None :
530
+ def save (self , ** kwargs : Any ) -> Optional [ Dict [ str , Any ]] :
531
531
"""Save the changes made to the object to the server.
532
532
533
533
The object is updated to match what the server returns.
@@ -542,15 +542,18 @@ def save(self, **kwargs: Any) -> None:
542
542
updated_data = self ._get_updated_data ()
543
543
# Nothing to update. Server fails if sent an empty dict.
544
544
if not updated_data :
545
- return
545
+ return None
546
546
547
547
# call the manager
548
548
obj_id = self .get_id ()
549
549
if TYPE_CHECKING :
550
550
assert isinstance (self .manager , UpdateMixin )
551
+ if isinstance (obj_id , str ):
552
+ obj_id = utils ._url_encode (obj_id )
551
553
server_data = self .manager .update (obj_id , updated_data , ** kwargs )
552
554
if server_data is not None :
553
555
self ._update_attrs (server_data )
556
+ return server_data
554
557
555
558
556
559
class ObjectDeleteMixin (_RestObjectBase ):
Original file line number Diff line number Diff line change
1
+ """
2
+ GitLab API:
3
+ https://docs.gitlab.com/ee/api/wikis.html
4
+ """
5
+
6
+
7
+ def test_wikis (project ):
8
+
9
+ page = project .wikis .create ({"title" : "title/subtitle" , "content" : "test content" })
10
+ page .content = "update content"
11
+ page .title = "subtitle"
12
+
13
+ page .save ()
14
+
15
+ page .delete ()
You can’t perform that action at this time.
0 commit comments