@@ -530,7 +530,7 @@ class ApplicationSettingsManager(GetWithoutIdMixin, UpdateMixin, RESTManager):
530530 )
531531
532532 @exc .on_http_error (exc .GitlabUpdateError )
533- def update (self , id = None , new_data = {} , ** kwargs ):
533+ def update (self , id = None , new_data = None , ** kwargs ):
534534 """Update an object on the server.
535535
536536 Args:
@@ -545,7 +545,7 @@ def update(self, id=None, new_data={}, **kwargs):
545545 GitlabAuthenticationError: If authentication is not correct
546546 GitlabUpdateError: If the server cannot perform the request
547547 """
548-
548+ new_data = new_data or {}
549549 data = new_data .copy ()
550550 if "domain_whitelist" in data and data ["domain_whitelist" ] is None :
551551 data .pop ("domain_whitelist" )
@@ -865,13 +865,14 @@ class GroupLabelManager(ListMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTMa
865865 _update_attrs = (("name" ,), ("new_name" , "color" , "description" , "priority" ))
866866
867867 # Update without ID.
868- def update (self , name , new_data = {} , ** kwargs ):
868+ def update (self , name , new_data = None , ** kwargs ):
869869 """Update a Label on the server.
870870
871871 Args:
872872 name: The name of the label
873873 **kwargs: Extra options to send to the server (e.g. sudo)
874874 """
875+ new_data = new_data or {}
875876 new_data ["name" ] = name
876877 super ().update (id = None , new_data = new_data , ** kwargs )
877878
@@ -2994,13 +2995,14 @@ class ProjectLabelManager(
29942995 _update_attrs = (("name" ,), ("new_name" , "color" , "description" , "priority" ))
29952996
29962997 # Update without ID.
2997- def update (self , name , new_data = {} , ** kwargs ):
2998+ def update (self , name , new_data = None , ** kwargs ):
29982999 """Update a Label on the server.
29993000
30003001 Args:
30013002 name: The name of the label
30023003 **kwargs: Extra options to send to the server (e.g. sudo)
30033004 """
3005+ new_data = new_data or {}
30043006 new_data ["name" ] = name
30053007 super ().update (id = None , new_data = new_data , ** kwargs )
30063008
@@ -3130,7 +3132,7 @@ def create(self, data, **kwargs):
31303132 return self ._obj_cls (self , server_data )
31313133
31323134 @exc .on_http_error (exc .GitlabUpdateError )
3133- def update (self , file_path , new_data = {} , ** kwargs ):
3135+ def update (self , file_path , new_data = None , ** kwargs ):
31343136 """Update an object on the server.
31353137
31363138 Args:
@@ -3145,7 +3147,7 @@ def update(self, file_path, new_data={}, **kwargs):
31453147 GitlabAuthenticationError: If authentication is not correct
31463148 GitlabUpdateError: If the server cannot perform the request
31473149 """
3148-
3150+ new_data = new_data or {}
31493151 data = new_data .copy ()
31503152 file_path = file_path .replace ("/" , "%2F" )
31513153 data ["file_path" ] = file_path
@@ -3632,7 +3634,7 @@ def get(self, id, **kwargs):
36323634 obj .id = id
36333635 return obj
36343636
3635- def update (self , id = None , new_data = {} , ** kwargs ):
3637+ def update (self , id = None , new_data = None , ** kwargs ):
36363638 """Update an object on the server.
36373639
36383640 Args:
@@ -3647,6 +3649,7 @@ def update(self, id=None, new_data={}, **kwargs):
36473649 GitlabAuthenticationError: If authentication is not correct
36483650 GitlabUpdateError: If the server cannot perform the request
36493651 """
3652+ new_data = new_data or {}
36503653 super (ProjectServiceManager , self ).update (id , new_data , ** kwargs )
36513654 self .id = id
36523655
@@ -4182,7 +4185,7 @@ def unshare(self, group_id, **kwargs):
41824185 # variables not supported in CLI
41834186 @cli .register_custom_action ("Project" , ("ref" , "token" ))
41844187 @exc .on_http_error (exc .GitlabCreateError )
4185- def trigger_pipeline (self , ref , token , variables = {} , ** kwargs ):
4188+ def trigger_pipeline (self , ref , token , variables = None , ** kwargs ):
41864189 """Trigger a CI build.
41874190
41884191 See https://gitlab.com/help/ci/triggers/README.md#trigger-a-build
@@ -4197,6 +4200,7 @@ def trigger_pipeline(self, ref, token, variables={}, **kwargs):
41974200 GitlabAuthenticationError: If authentication is not correct
41984201 GitlabCreateError: If the server failed to perform the request
41994202 """
4203+ variables = variables or {}
42004204 path = "/projects/%s/trigger/pipeline" % self .get_id ()
42014205 post_data = {"ref" : ref , "token" : token , "variables" : variables }
42024206 attrs = self .manager .gitlab .http_post (path , post_data = post_data , ** kwargs )
0 commit comments