From 577fffa279dd18dc7dfc2ef3b15cd6828ad04a60 Mon Sep 17 00:00:00 2001 From: Masco Kaliyamoorthy Date: Wed, 6 May 2015 17:46:47 +0530 Subject: [PATCH] Hide remove rule if no rule inserted in FW policy Hide 'remove rule' row action in firewall policies, if no rule is inserted in it. Change-Id: I7478f01c062ac20d23b4cfe6c8478d9881a6218c Closes-Bug: #1452257 --- openstack_dashboard/dashboards/project/firewalls/tables.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openstack_dashboard/dashboards/project/firewalls/tables.py b/openstack_dashboard/dashboards/project/firewalls/tables.py index 23ad55f730..74feb983a6 100644 --- a/openstack_dashboard/dashboards/project/firewalls/tables.py +++ b/openstack_dashboard/dashboards/project/firewalls/tables.py @@ -192,6 +192,11 @@ class RemoveRuleFromPolicyLink(policy.PolicyTargetMixin, kwargs={'policy_id': policy.id}) return base_url + def allowed(self, request, policy): + if len(policy.rules) > 0: + return True + return False + class AddRouterToFirewallLink(policy.PolicyTargetMixin, tables.LinkAction):