Fix issue with query when manifest count is 0

This commit is contained in:
Joseph Schorr 2015-11-19 17:44:16 -05:00
parent d8f395447e
commit 4981ccbc4e

View file

@ -148,6 +148,8 @@ def garbage_collect_tags(repo):
.join(RepositoryTag) .join(RepositoryTag)
.where(RepositoryTag.id << tags_to_delete)) .where(RepositoryTag.id << tags_to_delete))
num_deleted_manifests = 0
if len(manifests_to_delete) > 0:
num_deleted_manifests = (TagManifest num_deleted_manifests = (TagManifest
.delete() .delete()
.where(TagManifest.id << manifests_to_delete) .where(TagManifest.id << manifests_to_delete)