Browse Source

Fix the data value check in generic fieldtype

Yann Weber 8 years ago
parent
commit
801414fcc2
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      EditorialModel/fieldtypes/generic.py

+ 4
- 2
EditorialModel/fieldtypes/generic.py View File

@@ -66,8 +66,10 @@ class GenericFieldType(object):
66 66
     # @param value * : The value to check
67 67
     # @return (checked_and_casted_value, Exception|None)
68 68
     def check_data_value(self, value):
69
-        if value is None and not self.nullable:
70
-            return (None, TypeError("'None' value but field is not nullable"))
69
+        if value is None:
70
+            if not self.nullable:
71
+                return (None, TypeError("'None' value but field is not nullable"))
72
+            return (None, None)
71 73
         return self._check_data_value(value)
72 74
     
73 75
     ## @brief Build automatic fields values

Loading…
Cancel
Save