From 27146ec802e27788dfe45e2676c97f90883460b6 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Mon, 16 Mar 2015 16:09:06 +0100 Subject: [PATCH] Validate role using its api method Change-Id: I188dc41b484f2e219d62af6631a703111fe67adf --- tuskar_boxes/overview/views.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tuskar_boxes/overview/views.py b/tuskar_boxes/overview/views.py index d7f30f2..83fe75e 100644 --- a/tuskar_boxes/overview/views.py +++ b/tuskar_boxes/overview/views.py @@ -149,11 +149,8 @@ class IndexView(views.IndexView): if field: field.initial = 0 free_roles.append(role) - # For now, role is valid if it has image. - if role['role'].image: - role['is_valid'] = True - else: - role['is_valid'] = False + role['is_valid'] = role[ + 'role'].is_valid_for_deployment(data['plan']) data['free_roles'] = free_roles flavor_data = list( _flavor_data(self.request, flavors, flavor_roles))