This commit is contained in:
Ubuntu 2013-10-02 21:29:22 +00:00
commit aa6468d27f

View file

@ -287,6 +287,9 @@ def get_parent_images(image_obj):
parents = image_obj.ancestors
parent_db_ids = parents.strip('/').split('/')
if parent_db_ids == ['']:
return []
or_clauses = [(Image.id == db_id) for db_id in parent_db_ids]
parent_images = Image.select().where(reduce(operator.or_, or_clauses))
id_to_image = {unicode(image.id): image for image in parent_images}