diff --git a/rhodecode/lib/middleware/simplegit.py b/rhodecode/lib/middleware/simplegit.py --- a/rhodecode/lib/middleware/simplegit.py +++ b/rhodecode/lib/middleware/simplegit.py @@ -126,7 +126,7 @@ class SimpleGit(BaseVCSController): return HTTPInternalServerError()(environ, start_response) # quick check if that dir exists... - if is_valid_repo(repo_name, self.basepath, 'git') is False: + if not is_valid_repo(repo_name, self.basepath, 'git'): return HTTPNotFound()(environ, start_response) #====================================================================== @@ -143,11 +143,11 @@ class SimpleGit(BaseVCSController): anonymous_perm = self._check_permission(action, anonymous_user, repo_name, ip_addr) - if anonymous_perm is not True or anonymous_user.active is False: - if anonymous_perm is not True: + if not anonymous_perm or not anonymous_user.active: + if not anonymous_perm: log.debug('Not enough credentials to access this ' 'repository as anonymous user') - if anonymous_user.active is False: + if not anonymous_user.active: log.debug('Anonymous access is disabled, running ' 'authentication') #============================================================== @@ -184,7 +184,7 @@ class SimpleGit(BaseVCSController): #check permissions for this repository perm = self._check_permission(action, user, repo_name, ip_addr) - if perm is not True: + if not perm: return HTTPForbidden()(environ, start_response) # extras are injected into UI object and later available