Author: jmorliaguet
Date: Sun Apr 30 13:18:45 2006
New Revision: 2993

Modified:
   cpsskins/branches/paris-sprint-2006/setup/io.py
Log:

- don't fall back silently if no field adapter is found.



Modified: cpsskins/branches/paris-sprint-2006/setup/io.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/io.py     (original)
+++ cpsskins/branches/paris-sprint-2006/setup/io.py     Sun Apr 30 13:18:45 2006
@@ -84,16 +84,16 @@
             obj = getattr(context, attr)
 
             field_io = IFieldIO(field, None)
-            if field_io is not None:
-                value = field_io.dump(obj)
+            if field_io is None:
+                raise TypeError("No field adapter found for '%s'." % field)
             else:
-                value = obj
+                value = field_io.dump(obj)
 
             # set the property as an attribute,
             if attr in self.attributes:
                 element_el.setAttribute(attr, value)
 
-            # or as a child elements
+            # or as a child element
             else:
                 prop_el = document.createElement(attr)
                 prop_el.setAttribute(u'value', value)
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to