Skip to content

Commit 7d31e48

Browse files
committed
Forgot to add sudo-support to update
1 parent 5d25344 commit 7d31e48

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

gitlab.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ def update(self, obj, **kwargs):
420420
headers = self._createHeaders(content_type="application/json")
421421

422422
# build data that can really be sent to server
423-
data = obj._dataForGitlab()
423+
data = obj._dataForGitlab(extra_parameters=kwargs)
424424

425425
try:
426426
r = requests.put(url, data=data,
@@ -942,9 +942,10 @@ class ProjectIssue(GitlabObject):
942942
def _dataForGitlab(self, extra_parameters={}):
943943
# Gitlab-api returns labels in a json list and takes them in a
944944
# comma separated list.
945-
if hasattr(self, "labels") and self.labels is not None:
946-
labels = ", ".join(self.labels)
947-
extra_parameters.update(labels)
945+
if hasattr(self, "labels"):
946+
if self.labels is not None and not isinstance(self.labels, six.string_types):
947+
labels = ", ".join(self.labels)
948+
extra_parameters['labels'] = labels
948949

949950
return super(ProjectIssue, self)._dataForGitlab(extra_parameters)
950951

0 commit comments

Comments
 (0)