From 9022617d9a3faa311842d34e708d42abca8e6a1b Mon Sep 17 00:00:00 2001 From: Tatiana Ovchinnikova Date: Thu, 10 Sep 2015 12:52:55 +0300 Subject: [PATCH] Fix FWaaS Rules table displaying When we try to add a new firewall rule, it has no policy connection by default: we should use "Insert Rule" from Policies table. However, horizon can't display FWaaS tables anymore, breaking with error: "'NoneType' object has no attribute 'id'". This patch adds a policy check to "get_policy_link" method to show firewall rules without policy connections. Closes-Bug: #1494216 Change-Id: Iab283181428ede84cbc020ebf52a171714f56fa1 --- openstack_dashboard/dashboards/project/firewalls/tables.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openstack_dashboard/dashboards/project/firewalls/tables.py b/openstack_dashboard/dashboards/project/firewalls/tables.py index 41d02f48d0..b726dbcf29 100644 --- a/openstack_dashboard/dashboards/project/firewalls/tables.py +++ b/openstack_dashboard/dashboards/project/firewalls/tables.py @@ -257,8 +257,9 @@ def get_policy_name(datum): def get_policy_link(datum): - return reverse('horizon:project:firewalls:policydetails', - kwargs={'policy_id': datum.policy.id}) + if datum.policy: + return reverse('horizon:project:firewalls:policydetails', + kwargs={'policy_id': datum.policy.id}) class RulesTable(tables.DataTable):