Browse Source

compare strings using "==" not "is", fixes #1980

luto 7 years ago
parent
commit
0b825ac3d0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      netbox/extras/models.py

+ 1 - 1
netbox/extras/models.py

@@ -127,7 +127,7 @@ class CustomField(models.Model):
         """
         """
         Convert a string into the object it represents depending on the type of field
         Convert a string into the object it represents depending on the type of field
         """
         """
-        if serialized_value is '':
+        if serialized_value == '':
             return None
             return None
         if self.type == CF_TYPE_INTEGER:
         if self.type == CF_TYPE_INTEGER:
             return int(serialized_value)
             return int(serialized_value)