Avoid invalid links when no policy is associated
ingress/egress_firewall_policy_id of a firewall group can be null. Previously the firewall group detail page always create a link even when ingress/egress_firewall_policy_id is null and it leads to an invalid link. Change-Id: I491482789385e9d9735ebcafcc5574fc11fdd2ac
This commit is contained in:
parent
2b7675ea5a
commit
285c481f0d
|
@ -16,13 +16,21 @@
|
|||
|
||||
<dt>{% trans "Ingress Policy ID" %}</dt>
|
||||
<dd>
|
||||
{% if firewall_group.ingress_firewall_policy_id %}
|
||||
{% url 'horizon:project:firewalls_v2:policydetails' firewall_group.ingress_firewall_policy_id as policy_url %}
|
||||
<a href="{{ policy_url }}">{{firewall_group.ingress_policy.name|default:firewall_group.ingress_firewall_policy_id }}</a>
|
||||
{% else %}
|
||||
{% trans "-" %}
|
||||
{% endif %}
|
||||
</dd>
|
||||
<dt>{% trans "Egress Policy ID" %}</dt>
|
||||
<dd>
|
||||
{% if firewall_group.egress_firewall_policy_id %}
|
||||
{% url 'horizon:project:firewalls_v2:policydetails' firewall_group.egress_firewall_policy_id as policy_url %}
|
||||
<a href="{{ policy_url }}">{{firewall_group.egress_policy.name|default:firewall_group.egress_firewall_policy_id }}</a>
|
||||
{% else %}
|
||||
{% trans "-" %}
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
||||
<dt>{% trans "Status" %}</dt>
|
||||
|
|
Loading…
Reference in New Issue