repositories: use remote function to check if repo is empty

- changed 2 cases where we want to check for None instead of __bool__ of repo object
This commit is contained in:
Marcin Kuzminski 2019-06-05 13:30:26 +02:00
parent de07e75f22
commit 39e6f817c7
3 changed files with 6 additions and 3 deletions

View file

@ -244,7 +244,10 @@ class RepoAppView(BaseAppView):
c.repository_requirements_missing = {}
try:
self.rhodecode_vcs_repo = self.db_repo.scm_instance()
if self.rhodecode_vcs_repo:
# NOTE(marcink):
# comparison to None since if it's an object __bool__ is expensive to
# calculate
if self.rhodecode_vcs_repo is not None:
path_perms = self.rhodecode_vcs_repo.get_path_permissions(
c.auth_user.username)
self.path_filter = PathFilter(path_perms)