Fix subquery delete which messes up MySQL

Fixes #1061
This commit is contained in:
Joseph Schorr 2015-12-15 13:15:10 -05:00
parent 688b6f935f
commit 141f664bf7

View file

@ -49,7 +49,10 @@ def _purge_all_repository_tags(namespace_name, repository_name):
(namespace_name, repository_name))
# Delete all manifests.
repo_tags = RepositoryTag.select().where(RepositoryTag.repository == repo.id)
repo_tags = list(RepositoryTag.select().where(RepositoryTag.repository == repo.id))
if not repo_tags:
return
TagManifest.delete().where(TagManifest.tag << repo_tags).execute()
# Delete all tags.