Prevent peewee from loading the visibility every time

By calling `visibility` instead of `visibility_id`, peewee was issuing a SQL Select statement for the repository, which removes the benefit of the optimization
This commit is contained in:
Joseph Schorr 2017-02-17 12:09:48 -05:00
parent 7cb2da4cea
commit eece782038

View file

@ -393,7 +393,7 @@ def lookup_repository(repo_id):
def is_repository_public(repository):
return repository.visibility == _basequery.get_public_repo_visibility()
return repository.visibility_id == _basequery.get_public_repo_visibility().id
def repository_is_public(namespace_name, repository_name):