Commit 1fb8289a2ac3b8eb439ed64a5bcf5e255ede0722
Committed by
Lucas Kanashiro
1 parent
b7e59f6b
Exists in
master
and in
27 other branches
Fixed GitlabGroup url and projects property
Signed-off-by: Macartur Sousa <macartur.sc@gmail.com>
Showing
1 changed file
with
10 additions
and
1 deletions
Show diff stats
colab/plugins/gitlab/models.py
... | ... | @@ -34,8 +34,17 @@ class GitlabGroup(models.Model): |
34 | 34 | return u'{}'.format(self.path) |
35 | 35 | |
36 | 36 | @property |
37 | + def projects(self): | |
38 | + projects = GitlabProject.objects.all() | |
39 | + result = list() | |
40 | + for project in projects: | |
41 | + if self.path in project.group: | |
42 | + result.append(project) | |
43 | + return result | |
44 | + | |
45 | + @property | |
37 | 46 | def url(self): |
38 | - return u'/gitlab/groups/{}'.format(self.id) | |
47 | + return u'/gitlab/groups/{}'.format(self.path) | |
39 | 48 | |
40 | 49 | class Meta: |
41 | 50 | verbose_name = _('Gitlab Group') | ... | ... |