Merge pull request #1981 from luto/patch-1

compare strings using "==" not "is", fix crash bug
This commit is contained in:
Jeremy Stretch 2018-03-21 15:22:00 -04:00 committed by GitHub
commit 7e92aeb7ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)