dataimport.py
changeset 10294 277074659cad
parent 10286 0f8c3ac88f1e
child 10295 080ac14df6fa
--- a/dataimport.py	Fri Mar 27 17:23:06 2015 +0100
+++ b/dataimport.py	Sun Feb 01 22:14:44 2015 +0100
@@ -883,6 +883,9 @@
     def init_entity(self, entity):
         entity.eid = self.source.create_eid(self._cnx)
         for attr in self.entity_attrs:
+            if attr in entity.cw_edited:
+                # already set, skip this attribute
+                continue
             genfunc = self.generate(attr)
             if genfunc:
                 entity.cw_edited.edited_attribute(attr, genfunc(entity))
@@ -891,6 +894,7 @@
         return getattr(self, 'gen_%s' % rtype, None)
 
     def gen_cwuri(self, entity):
+        assert self.baseurl, 'baseurl is None while generating cwuri'
         return u'%s%s' % (self.baseurl, entity.eid)
 
     def gen_creation_date(self, entity):