From ed9228aa8dbfea76826f1e3e60942fa3ce9ce91d Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 7 Apr 2006 02:57:05 +0000 Subject: [PATCH] select parents from relationship view svn: r6284 --- gramps2/src/DataViews/_FamilyView.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/gramps2/src/DataViews/_FamilyView.py b/gramps2/src/DataViews/_FamilyView.py index 807cf1c16..d15da0901 100644 --- a/gramps2/src/DataViews/_FamilyView.py +++ b/gramps2/src/DataViews/_FamilyView.py @@ -694,19 +694,20 @@ class FamilyView(PageView.PersonNavView): dialog = SelectFamily(self.dbstate.db, _('Select Family')) family = dialog.run() - person = self.dbstate.db.get_person_from_handle(self.dbstate.active.handle) + if family: + person = self.dbstate.db.get_person_from_handle(self.dbstate.active.handle) - family.add_child_handle(person.handle) - - person.add_parent_family_handle( - family.handle, - (RelLib.Person.CHILD_BIRTH,''), - (RelLib.Person.CHILD_BIRTH,'')) - - trans = self.dbstate.db.transaction_begin() - self.dbstate.db.commit_person(person,trans) - self.dbstate.db.commit_family(family,trans) - self.dbstate.db.transaction_commit(trans,_("Add Family")) + family.add_child_handle(person.handle) + + person.add_parent_family_handle( + family.handle, + (RelLib.Person.CHILD_BIRTH,''), + (RelLib.Person.CHILD_BIRTH,'')) + + trans = self.dbstate.db.transaction_begin() + self.dbstate.db.commit_person(person,trans) + self.dbstate.db.commit_family(family,trans) + self.dbstate.db.transaction_commit(trans,_("Add Family")) def add_parent_family(self,obj,event,handle): if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1: