implements: make twice list iterations into one
Closes-Bug: 1644817 Change-Id: Ie97659230ad59f56a0285e7f693683bde32dca77
This commit is contained in:
parent
11f6e3de48
commit
fca1dabf26
|
@ -67,15 +67,14 @@ def get_available_images(request, project_id=None, images_cache=None):
|
|||
|
||||
images = owned_images + public_images
|
||||
|
||||
# Remove duplicate images
|
||||
image_ids = []
|
||||
final_images = []
|
||||
for image in images:
|
||||
if image.id not in image_ids:
|
||||
if image.id not in image_ids and \
|
||||
image.container_format not in ('aki', 'ari'):
|
||||
image_ids.append(image.id)
|
||||
final_images.append(image)
|
||||
return [image for image in final_images
|
||||
if image.container_format not in ('aki', 'ari')]
|
||||
return final_images
|
||||
|
||||
|
||||
def image_field_data(request, include_empty_option=False):
|
||||
|
|
Loading…
Reference in New Issue