[migration] Enhance assertion message to get a chance to fix the problem 3.24
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 19 Jan 2017 11:12:35 +0100
branch3.24
changeset 11907 3be141d6c82c
parent 11906 51057823b528
child 11908 7904fe436e82
[migration] Enhance assertion message to get a chance to fix the problem
cubicweb/server/migractions.py
--- a/cubicweb/server/migractions.py	Thu Jan 19 11:12:07 2017 +0100
+++ b/cubicweb/server/migractions.py	Thu Jan 19 11:12:35 2017 +0100
@@ -1133,7 +1133,8 @@
             schemaobj = getattr(rdef, attr)
             if getattr(schemaobj, 'eid', None) is None:
                 schemaobj.eid = self.repo.schema[schemaobj].eid
-                assert schemaobj.eid is not None, schemaobj
+                assert schemaobj.eid is not None, \
+                    '%s has no eid while adding %s' % (schemaobj, rdef)
         return rdef
 
     def cmd_drop_relation_definition(self, subjtype, rtype, objtype, commit=True):