Skip to content

Commit

Permalink
Forgot to add sudo-support to update
Browse files Browse the repository at this point in the history
  • Loading branch information
mjmaenpaa committed Dec 5, 2014
1 parent 5d25344 commit 7d31e48
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions gitlab.py
Expand Up @@ -420,7 +420,7 @@ def update(self, obj, **kwargs):
headers = self._createHeaders(content_type="application/json")

# build data that can really be sent to server
data = obj._dataForGitlab()
data = obj._dataForGitlab(extra_parameters=kwargs)

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

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

Expand Down

0 comments on commit 7d31e48

Please sign in to comment.