Import of Contact Relationships fails with DuplicateRelationship error

Bug #882482 reported by Gediminas Paulauskas on 2011-10-27
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Alan Elkner

Bug Description

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

File "/home/menesis/.buildout/eggs/zope.publisher-3.12.6-py2.7.egg/zope/publisher/", line 132, in publish
  result = publication.callObject(request, obj)
File "/home/menesis/.buildout/eggs/", 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/", line 107, in mapply
  return debug_call(obj, args)
Extra information: < object at 0xf4835cc>
File "/home/menesis/.buildout/eggs/zope.publisher-3.12.6-py2.7.egg/zope/publisher/", line 113, in debug_call
  return obj(*args)
File "/home/menesis/src/schooltool/flourish/src/schooltool/src/schooltool/skin/flourish/", line 68, in __call__
File "/home/menesis/src/schooltool/flourish/src/schooltool/src/schooltool/export/", line 1286, in update
File "/home/menesis/src/schooltool/flourish/src/schooltool/src/schooltool/export/", line 262, in import_data
  return self.process()
File "/home/menesis/src/schooltool/flourish/src/schooltool/src/schooltool/export/", line 915, in process
  IContactable(person).contacts.add(contact, info)
File "/home/menesis/src/schooltool/flourish/src/schooltool/src/schooltool/relationship/", line 376, in add
  (other, self.other_role), extra_info)
File "/home/menesis/src/schooltool/flourish/src/schooltool/src/schooltool/relationship/", line 54, in relate
  raise 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 (Bug #608873).

description: updated
Alan Elkner (aelkner) on 2011-11-14
Changed in schooltool:
status: New → Fix Committed
Gediminas Paulauskas (menesis) wrote :

Thank you very much!

Changed in schooltool:
milestone: none → 1.9.3
Changed in schooltool:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers