2
0
Эх сурвалжийг харах

Fixes #8033: Fix display of zero values for custom integer fields in tables

jeremystretch 4 жил өмнө
parent
commit
1df05715c2

+ 1 - 0
docs/release-notes/version-3.1.md

@@ -12,6 +12,7 @@
 * [#8009](https://github.com/netbox-community/netbox/issues/8009) - Validate IP addresses for uniqueness when creating an FHRP group
 * [#8010](https://github.com/netbox-community/netbox/issues/8010) - Allow filtering devices by multiple serial numbers
 * [#8019](https://github.com/netbox-community/netbox/issues/8019) - Exclude metrics endpoint when `LOGIN_REQUIRED` is true
+* [#8033](https://github.com/netbox-community/netbox/issues/8033) - Fix display of zero values for custom integer fields in tables
 
 ---
 

+ 3 - 1
netbox/utilities/tables.py

@@ -415,7 +415,9 @@ class CustomFieldColumn(tables.Column):
         elif self.customfield.type == CustomFieldTypeChoices.TYPE_URL:
             # Linkify custom URLs
             return mark_safe(f'<a href="{value}">{value}</a>')
-        return value or self.default
+        if value is not None:
+            return value
+        return self.default
 
 
 class MPTTColumn(tables.TemplateColumn):