Only lookup if the repo is public if necessary

This commit is contained in:
Joseph Schorr 2014-12-18 18:08:50 +02:00
parent 79b61e7709
commit 5168f47321

View file

@ -305,9 +305,7 @@ def get_repository_images(namespace, repository):
permission = ReadRepositoryPermission(namespace, repository)
# TODO invalidate token?
profile.debug('Looking up public status of repository')
is_public = model.repository_is_public(namespace, repository)
if permission.can() or is_public:
if permission.can() or model.repository_is_public(namespace, repository):
# We can't rely on permissions to tell us if a repo exists anymore
profile.debug('Looking up repository')
repo = model.get_repository(namespace, repository)