@@ -222,10 +222,10 @@ def _data_for_gitlab(self, extra_parameters={}, update=False,
222
222
for attribute in attributes :
223
223
if hasattr (self , attribute ):
224
224
value = getattr (self , attribute )
225
- if isinstance ( value , list ):
226
- if value and isinstance (value [ 0 ], six . string_types ):
227
- value = "," .join (value )
228
- if attribute == 'sudo' :
225
+ # labels need to be sent as a comma-separated list
226
+ if attribute == 'labels' and isinstance (value , list ):
227
+ value = ", " .join (value )
228
+ elif attribute == 'sudo' :
229
229
value = str (value )
230
230
data [attribute ] = value
231
231
@@ -764,6 +764,15 @@ class ApplicationSettings(GitlabObject):
764
764
canCreate = False
765
765
canDelete = False
766
766
767
+ def _data_for_gitlab (self , extra_parameters = {}, update = False ,
768
+ as_json = True ):
769
+ data = (super (ApplicationSettings , self )
770
+ ._data_for_gitlab (extra_parameters , update = update ,
771
+ as_json = False ))
772
+ if not self .domain_whitelist :
773
+ data .pop ('domain_whitelist' , None )
774
+ return json .dumps (data )
775
+
767
776
768
777
class ApplicationSettingsManager (BaseManager ):
769
778
obj_cls = ApplicationSettings
@@ -1458,19 +1467,6 @@ class ProjectIssue(GitlabObject):
1458
1467
[('project_id' , 'project_id' ), ('issue_id' , 'id' )]),
1459
1468
)
1460
1469
1461
- def _data_for_gitlab (self , extra_parameters = {}, update = False ,
1462
- as_json = True ):
1463
- # Gitlab-api returns labels in a json list and takes them in a
1464
- # comma separated list.
1465
- if hasattr (self , "labels" ):
1466
- if (self .labels is not None and
1467
- not isinstance (self .labels , six .string_types )):
1468
- labels = ", " .join (self .labels )
1469
- extra_parameters ['labels' ] = labels
1470
-
1471
- return super (ProjectIssue , self )._data_for_gitlab (extra_parameters ,
1472
- update )
1473
-
1474
1470
def subscribe (self , ** kwargs ):
1475
1471
"""Subscribe to an issue.
1476
1472
0 commit comments