diff --git a/data/model/legacy.py b/data/model/legacy.py index 811979981..eca811060 100644 --- a/data/model/legacy.py +++ b/data/model/legacy.py @@ -1089,6 +1089,9 @@ def _get_repository_images_base(namespace_name, repository_name, query_modifier) # Make sure we're always retrieving the same image object. image = location.storage.image + # Set the storage to the one we got from the location, to prevent another query + image.storage = location.storage + if not image.id in images: images[image.id] = image image.storage.locations = set()