Commit 49b3009205d97cda17e6ec7c67a13a6c576ef72c
Committed by
Lucas Kanashiro
1 parent
bdd65848
Exists in
master
and in
28 other branches
Fix issue iid
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
colab/plugins/gitlab/models.py
@@ -64,6 +64,7 @@ class GitlabMergeRequest(Collaboration): | @@ -64,6 +64,7 @@ class GitlabMergeRequest(Collaboration): | ||
64 | class GitlabIssue(Collaboration): | 64 | class GitlabIssue(Collaboration): |
65 | 65 | ||
66 | id = models.IntegerField(primary_key=True) | 66 | id = models.IntegerField(primary_key=True) |
67 | + iid = models.IntegerField(null=True) | ||
67 | project = models.ForeignKey(GitlabProject, null=True, | 68 | project = models.ForeignKey(GitlabProject, null=True, |
68 | on_delete=models.SET_NULL) | 69 | on_delete=models.SET_NULL) |
69 | title = models.TextField() | 70 | title = models.TextField() |
@@ -82,7 +83,7 @@ class GitlabIssue(Collaboration): | @@ -82,7 +83,7 @@ class GitlabIssue(Collaboration): | ||
82 | @property | 83 | @property |
83 | def url(self): | 84 | def url(self): |
84 | return u'/gitlab/{}/issues/{}'.format( | 85 | return u'/gitlab/{}/issues/{}'.format( |
85 | - self.project.path_with_namespace, self.id) | 86 | + self.project.path_with_namespace, self.iid) |
86 | 87 | ||
87 | class Meta: | 88 | class Meta: |
88 | verbose_name = _('Gitlab Issue') | 89 | verbose_name = _('Gitlab Issue') |
@@ -92,7 +93,6 @@ class GitlabIssue(Collaboration): | @@ -92,7 +93,6 @@ class GitlabIssue(Collaboration): | ||
92 | class GitlabComment(Collaboration): | 93 | class GitlabComment(Collaboration): |
93 | 94 | ||
94 | id = models.IntegerField(primary_key=True) | 95 | id = models.IntegerField(primary_key=True) |
95 | - iid = models.IntegerField(null=True) | ||
96 | body = models.TextField() | 96 | body = models.TextField() |
97 | created_at = models.DateTimeField(blank=True, null=True) | 97 | created_at = models.DateTimeField(blank=True, null=True) |
98 | issue_comment = models.BooleanField(default=True) | 98 | issue_comment = models.BooleanField(default=True) |
@@ -139,7 +139,7 @@ class GitlabComment(Collaboration): | @@ -139,7 +139,7 @@ class GitlabComment(Collaboration): | ||
139 | url_str = u'/gitlab/{}/merge_requests/{}#notes_{}' | 139 | url_str = u'/gitlab/{}/merge_requests/{}#notes_{}' |
140 | 140 | ||
141 | return url_str.format(self.project.path_with_namespace, | 141 | return url_str.format(self.project.path_with_namespace, |
142 | - self.parent_id, self.iid) | 142 | + self.parent_id, self.id) |
143 | 143 | ||
144 | class Meta: | 144 | class Meta: |
145 | verbose_name = _('Gitlab Comments') | 145 | verbose_name = _('Gitlab Comments') |