[repo/sql] don't do anything when value is None. This will avoid None to be turned into False in the case of a boolean for instance. stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 17 Sep 2010 17:25:17 +0200
branchstable
changeset 6284 c35b2ebeb3c9
parent 6283 c827fa795a6b
child 6285 b8a2c9b9a2cb
[repo/sql] don't do anything when value is None. This will avoid None to be turned into False in the case of a boolean for instance.
server/sqlutils.py
--- a/server/sqlutils.py	Fri Sep 17 16:54:57 2010 +0200
+++ b/server/sqlutils.py	Fri Sep 17 17:25:17 2010 +0200
@@ -262,8 +262,7 @@
         eschema = entity.e_schema
         for attr in entity.edited_attributes:
             value = entity[attr]
-            rschema = eschema.subjrels[attr]
-            if rschema.final:
+            if value is not None and eschema.subjrels[attr].final:
                 atype = str(entity.e_schema.destination(attr))
                 if atype == 'Boolean':
                     value = self.dbhelper.boolean_value(value)