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]:
525525
526526 return updated_data
527527
528- def save (self , ** kwargs : Any ) -> None :
528+ def save (self , ** kwargs : Any ) -> Optional [ Dict [ str , Any ]] :
529529 """Save the changes made to the object to the server.
530530
531531 The object is updated to match what the server returns.
532532
533533 Args:
534534 **kwargs: Extra options to send to the server (e.g. sudo)
535535
536+ Returns:
537+ The new object data (*not* a RESTObject)
538+
536539 Raise:
537540 GitlabAuthenticationError: If authentication is not correct
538541 GitlabUpdateError: If the server cannot perform the request
539542 """
540543 updated_data = self ._get_updated_data ()
541544 # Nothing to update. Server fails if sent an empty dict.
542545 if not updated_data :
543- return
546+ return None
544547
545548 # call the manager
546549 obj_id = self .encoded_id
547550 if TYPE_CHECKING :
548551 assert isinstance (self .manager , UpdateMixin )
549552 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
552555
553556
554557class ObjectDeleteMixin (_RestObjectBase ):
You can’t perform that action at this time.
0 commit comments