Commit a1c6e0a0 authored by Michal Čihař's avatar Michal Čihař

Do not fail on empty subproject

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 7339b9d4
......@@ -265,9 +265,10 @@ class Project(models.Model, PercentMixin, URLMixin, PathMixin):
)
def is_git_locked(self):
return max(
[subproject.locked for subproject in self.subproject_set.all()]
)
subprojects = self.subproject_set.all()
if len(subprojects) == 0:
return False
return max([subproject.locked for subproject in subprojects])
def _get_path(self):
return os.path.join(appsettings.GIT_ROOT, self.slug)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment