From 58095e1916b09ef2b3c98833b7a64cf641a1111c Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 10 Dec 2021 15:38:51 -0500 Subject: [PATCH] Fixes #8038: Placeholder filter should display zero integer values --- docs/release-notes/version-3.1.md | 1 + netbox/utilities/templatetags/helpers.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-3.1.md b/docs/release-notes/version-3.1.md index 4c0049f9d..48129163b 100644 --- a/docs/release-notes/version-3.1.md +++ b/docs/release-notes/version-3.1.md @@ -17,6 +17,7 @@ * [#8030](https://github.com/netbox-community/netbox/issues/8030) - Validate custom field names * [#8033](https://github.com/netbox-community/netbox/issues/8033) - Fix display of zero values for custom integer fields in tables * [#8035](https://github.com/netbox-community/netbox/issues/8035) - Redirect back to parent prefix after creating IP address(es) where applicable +* [#8038](https://github.com/netbox-community/netbox/issues/8038) - Placeholder filter should display zero integer values --- diff --git a/netbox/utilities/templatetags/helpers.py b/netbox/utilities/templatetags/helpers.py index 2d0c8edd1..267bf7115 100644 --- a/netbox/utilities/templatetags/helpers.py +++ b/netbox/utilities/templatetags/helpers.py @@ -32,7 +32,7 @@ def placeholder(value): """ Render a muted placeholder if value equates to False. """ - if value: + if value not in ('', None): return value placeholder = '' return mark_safe(placeholder)