Correctly display role-flavor association

Role/flavor association wasn't correctly displayed on the overview page.

Change-Id: I7d64f9444911f6e9fbcb810806231f2ef5c5710e
This commit is contained in:
Ana Krivokapic 2015-01-15 17:37:52 +01:00
parent 6965d80958
commit 151e1e093c

View File

@ -139,7 +139,7 @@ class IndexView(views.IndexView):
if 'form' in data:
role['flavor_field'] = data['form'][role['id'] + '-flavor']
flavor = role['role'].flavor(data['plan'])
if flavor in flavors:
if flavor and flavor.id in [f.id for f in flavors]:
role['flavor_name'] = flavor.name
flavor_roles.setdefault(flavor.name, []).append(role)
else: