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,10 +148,12 @@ def garbage_collect_tags(repo):
.join(RepositoryTag) .join(RepositoryTag)
.where(RepositoryTag.id << tags_to_delete)) .where(RepositoryTag.id << tags_to_delete))
num_deleted_manifests = (TagManifest num_deleted_manifests = 0
.delete() if len(manifests_to_delete) > 0:
.where(TagManifest.id << manifests_to_delete) num_deleted_manifests = (TagManifest
.execute()) .delete()
.where(TagManifest.id << manifests_to_delete)
.execute())
num_deleted_tags = (RepositoryTag num_deleted_tags = (RepositoryTag
.delete() .delete()