Merge "Modified images list to be sorted alphabetically."

This commit is contained in:
Jenkins 2013-12-20 08:31:50 +00:00 committed by Gerrit Code Review
commit 10fb49695c
1 changed files with 1 additions and 0 deletions

View File

@ -307,6 +307,7 @@ class SetInstanceDetailsAction(workflows.Action):
image.volume_size = functions.bytes_to_gigabytes(image.bytes)
choices.append((image.id, image))
if choices:
choices.sort(key=lambda c: c[1].name)
choices.insert(0, ("", _("Select Image")))
else:
choices.insert(0, ("", _("No images available")))