From 0275896e110fc80403d270aa0bc46a21b003f681 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Tue, 2 May 2006 04:20:40 +0000 Subject: [PATCH] * src/GrampsDb/_GrampsBSDDB.py (gramps_upgrade_9): Skip broken witness. svn: r6511 --- gramps2/ChangeLog | 1 + gramps2/src/GrampsDb/_GrampsBSDDB.py | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 806587bc3..9ed5dd894 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -10,6 +10,7 @@ expand and collapse all node menu entries 2006-05-01 Alex Roitman + * src/GrampsDb/_GrampsBSDDB.py (gramps_upgrade_9): Skip broken witness. * src/GrampsDb/_GrampsDbBase.py (find_backlink_handles): Correctly loop over all primary classes looking for a given handle. * src/RelLib/_Source.py (serialize, unserialize): properly save diff --git a/gramps2/src/GrampsDb/_GrampsBSDDB.py b/gramps2/src/GrampsDb/_GrampsBSDDB.py index f0502cd76..ad347bca4 100644 --- a/gramps2/src/GrampsDb/_GrampsBSDDB.py +++ b/gramps2/src/GrampsDb/_GrampsBSDDB.py @@ -1496,18 +1496,19 @@ class GrampsBSDDB(GrampsDbBase): % witness.comment event.set_note(note_text) elif witness.type == 1: # witness ID recorded - # Add an EventRef from that person - # to this event using ROLE_WITNESS role - event_ref = EventRef() - event_ref.ref = event.handle - event_ref.role.set(EventRoleType.WITNESS) - # Add privacy and comment - event_ref.private = witness.private - if witness.comment: - event_ref.set_note(witness.comment) person = self.get_person_from_handle(witness.val) - person.event_ref_list.append(event_ref) - self.commit_person(person,trans) + if person: + # Add an EventRef from that person + # to this event using ROLE_WITNESS role + event_ref = EventRef() + event_ref.ref = event.handle + event_ref.role.set(EventRoleType.WITNESS) + # Add privacy and comment + event_ref.private = witness.private + if witness.comment: + event_ref.set_note(witness.comment) + person.event_ref_list.append(event_ref) + self.commit_person(person,trans) self.commit_event(event,trans) current += 1 self.update(100*current/length)