From 5d25344635d69c3c2c9bdc286bf1236c0343eca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=20M=C3=A4enp=C3=A4=C3=A4?= Date: Fri, 5 Dec 2014 12:56:36 +0200 Subject: [PATCH] Support labels in issues correctly --- gitlab.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gitlab.py b/gitlab.py index 8296d96c3..41cacbbc3 100644 --- a/gitlab.py +++ b/gitlab.py @@ -939,6 +939,15 @@ class ProjectIssue(GitlabObject): shortPrintAttr = 'title' + 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) + + return super(ProjectIssue, self)._dataForGitlab(extra_parameters) + def Note(self, id=None, **kwargs): return ProjectIssueNote._getListOrObject(self.gitlab, id, project_id=self.project_id,