From 71bf5f4697ebbd00d2ac87e7972961f5f6289851 Mon Sep 17 00:00:00 2001
From: atownson <52260120+atownson@users.noreply.github.com>
Date: Mon, 22 Aug 2022 15:17:35 -0500
Subject: [PATCH] Updated exists evaluation
---
netbox/templates/dcim/device.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html
index 217362311..a798a34b0 100644
--- a/netbox/templates/dcim/device.html
+++ b/netbox/templates/dcim/device.html
@@ -179,7 +179,7 @@
{{ object.primary_ip4.address.ip }}
{% 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 %}{{ nat.address.ip }}{% if not forloop.last %}, {% endif %}{% endfor %})
{% endif %}
{% else %}
@@ -194,7 +194,7 @@
{{ object.primary_ip6.address.ip }}
{% 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 %}{{ nat.address.ip }}{% if not forloop.last %}, {% endif %}{% endfor %})
{% endif %}
{% else %}