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

Fixes #22454: Fix serialization of decimal custom field values (#22460)

Jeremy Stretch 2 долоо хоног өмнө
parent
commit
9bfdea4787

+ 2 - 0
netbox/extras/models/customfields.py

@@ -461,6 +461,8 @@ class CustomField(CloningMixin, ExportTemplatesMixin, OwnerMixin, ChangeLoggedMo
         """
         if value is None:
             return value
+        if self.type == CustomFieldTypeChoices.TYPE_DECIMAL:
+            return float(value)
         if self.type == CustomFieldTypeChoices.TYPE_DATE and type(value) is date:
             return value.isoformat()
         if self.type == CustomFieldTypeChoices.TYPE_DATETIME and type(value) is datetime: