File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -525,30 +525,33 @@ def _get_updated_data(self) -> Dict[str, Any]:
525
525
526
526
return updated_data
527
527
528
- def save (self , ** kwargs : Any ) -> None :
528
+ def save (self , ** kwargs : Any ) -> Optional [ Dict [ str , Any ]] :
529
529
"""Save the changes made to the object to the server.
530
530
531
531
The object is updated to match what the server returns.
532
532
533
533
Args:
534
534
**kwargs: Extra options to send to the server (e.g. sudo)
535
535
536
+ Returns:
537
+ The new object data (*not* a RESTObject)
538
+
536
539
Raise:
537
540
GitlabAuthenticationError: If authentication is not correct
538
541
GitlabUpdateError: If the server cannot perform the request
539
542
"""
540
543
updated_data = self ._get_updated_data ()
541
544
# Nothing to update. Server fails if sent an empty dict.
542
545
if not updated_data :
543
- return
546
+ return None
544
547
545
548
# call the manager
546
549
obj_id = self .encoded_id
547
550
if TYPE_CHECKING :
548
551
assert isinstance (self .manager , UpdateMixin )
549
552
server_data = self .manager .update (obj_id , updated_data , ** kwargs )
550
- if server_data is not None :
551
- self . _update_attrs ( server_data )
553
+ self . _update_attrs ( server_data )
554
+ return server_data
552
555
553
556
554
557
class ObjectDeleteMixin (_RestObjectBase ):
You can’t perform that action at this time.
0 commit comments