Răsfoiți Sursa

Updated exists evaluation

atownson 3 ani în urmă
părinte
comite
71bf5f4697
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      netbox/templates/dcim/device.html

+ 2 - 2
netbox/templates/dcim/device.html

@@ -179,7 +179,7 @@
                                 <a href="{{ object.primary_ip4.get_absolute_url }}">{{ object.primary_ip4.address.ip }}</a>
                                 {% if object.primary_ip4.nat_inside %}
                                   (NAT for {{ object.primary_ip4.nat_inside.address.ip|linkify }})
-                                {% elif object.primary_ip4.nat_outside.count > 0 %}
+                                {% elif object.primary_ip4.nat_outside.exists %}
                                   (NAT for {% for nat in object.primary_ip4.nat_outside.all %}<a href="{{ nat.get_absolute_url }}">{{ nat.address.ip }}</a>{% if not forloop.last %}, {% endif %}{% endfor %})
                                 {% endif %}
                               {% else %}
@@ -194,7 +194,7 @@
                                 <a href="{{ object.primary_ip6.get_absolute_url }}">{{ object.primary_ip6.address.ip }}</a>
                                 {% if object.primary_ip6.nat_inside %}
                                   (NAT for {{ object.primary_ip6.nat_inside.address.ip|linkify }})
-                                {% elif object.primary_ip6.nat_outside.count > 0 %}
+                                {% elif object.primary_ip6.nat_outside.exists %}
                                   (NAT for {% for nat in object.primary_ip6.nat_outside.all %}<a href="{{ nat.get_absolute_url }}">{{ nat.address.ip }}</a>{% if not forloop.last %}, {% endif %}{% endfor %})
                                 {% endif %}
                               {% else %}