Commit 49b3009205d97cda17e6ec7c67a13a6c576ef72c

Authored by Gust
Committed by Lucas Kanashiro
1 parent bdd65848

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 64 class GitlabIssue(Collaboration):
65 65  
66 66 id = models.IntegerField(primary_key=True)
  67 + iid = models.IntegerField(null=True)
67 68 project = models.ForeignKey(GitlabProject, null=True,
68 69 on_delete=models.SET_NULL)
69 70 title = models.TextField()
... ... @@ -82,7 +83,7 @@ class GitlabIssue(Collaboration):
82 83 @property
83 84 def url(self):
84 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 88 class Meta:
88 89 verbose_name = _('Gitlab Issue')
... ... @@ -92,7 +93,6 @@ class GitlabIssue(Collaboration):
92 93 class GitlabComment(Collaboration):
93 94  
94 95 id = models.IntegerField(primary_key=True)
95   - iid = models.IntegerField(null=True)
96 96 body = models.TextField()
97 97 created_at = models.DateTimeField(blank=True, null=True)
98 98 issue_comment = models.BooleanField(default=True)
... ... @@ -139,7 +139,7 @@ class GitlabComment(Collaboration):
139 139 url_str = u'/gitlab/{}/merge_requests/{}#notes_{}'
140 140  
141 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 144 class Meta:
145 145 verbose_name = _('Gitlab Comments')
... ...