Explorar o código

Merge pull request #1981 from luto/patch-1

compare strings using "==" not "is", fix crash bug
Jeremy Stretch %!s(int64=8) %!d(string=hai) anos
pai
achega
7e92aeb7ac
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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
         """
-        if serialized_value is '':
+        if serialized_value == '':
             return None
         if self.type == CF_TYPE_INTEGER:
             return int(serialized_value)