Comment 0 for bug 882482

Revision history for this message
Gediminas Paulauskas (menesis) wrote :

I exported to xls, modified something, and tried to import. First, it failed on timetables (#878209), I deleted that sheet and tried again. Now I got exception in Contact Relationships:

Traceback:
File "/home/menesis/.buildout/eggs/zope.publisher-3.12.6-py2.7.egg/zope/publisher/publish.py", line 132, in publish
  result = publication.callObject(request, obj)
File "/home/menesis/.buildout/eggs/zope.app.publication-3.13.2-py2.7.egg/zope/app/publication/zopepublication.py", line 207, in callObject
  return mapply(ob, request.getPositionalArguments(), request)
File "/home/menesis/.buildout/eggs/zope.publisher-3.12.6-py2.7.egg/zope/publisher/publish.py", line 107, in mapply
  return debug_call(obj, args)
Extra information: <schooltool.skin.flourish.zcml_content.FlourishMegaImporter_import.html object at 0xf4835cc>
File "/home/menesis/.buildout/eggs/zope.publisher-3.12.6-py2.7.egg/zope/publisher/publish.py", line 113, in debug_call
  return obj(*args)
File "/home/menesis/src/schooltool/flourish/src/schooltool/src/schooltool/skin/flourish/page.py", line 68, in __call__
  self.update()
File "/home/menesis/src/schooltool/flourish/src/schooltool/src/schooltool/export/importer.py", line 1286, in update
  imp.import_data(wb)
File "/home/menesis/src/schooltool/flourish/src/schooltool/src/schooltool/export/importer.py", line 262, in import_data
  return self.process()
File "/home/menesis/src/schooltool/flourish/src/schooltool/src/schooltool/export/importer.py", line 915, in process
  IContactable(person).contacts.add(contact, info)
File "/home/menesis/src/schooltool/flourish/src/schooltool/src/schooltool/relationship/relationship.py", line 376, in add
  (other, self.other_role), extra_info)
File "/home/menesis/src/schooltool/flourish/src/schooltool/src/schooltool/relationship/relationship.py", line 54, in relate
  raise DuplicateRelationship
DuplicateRelationship:

This exception itself is not very informative, because it doesn't print person, contact, and relationship.

Maybe a row was in fact duplicated, then a human readable error should be displayed.

But what happens in this case is that without checking that such a relationship already exists, a new contact is being added.

So this not a user error, but a bug in the new contact import code.