From 4981ccbc4ede0457f25d6aa653c1e300e8411c9b Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 19 Nov 2015 17:44:16 -0500 Subject: [PATCH] Fix issue with query when manifest count is 0 --- data/model/tag.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/data/model/tag.py b/data/model/tag.py index f533e9a08..afc0b36cb 100644 --- a/data/model/tag.py +++ b/data/model/tag.py @@ -148,10 +148,12 @@ def garbage_collect_tags(repo): .join(RepositoryTag) .where(RepositoryTag.id << tags_to_delete)) - num_deleted_manifests = (TagManifest - .delete() - .where(TagManifest.id << manifests_to_delete) - .execute()) + num_deleted_manifests = 0 + if len(manifests_to_delete) > 0: + num_deleted_manifests = (TagManifest + .delete() + .where(TagManifest.id << manifests_to_delete) + .execute()) num_deleted_tags = (RepositoryTag .delete()