* src/plugins/Check.py: Add check for child handle in family, that does no longer exist in database
svn: r4238
This commit is contained in:
parent
c6551bef5f
commit
40cec6825e
@ -1,3 +1,7 @@
|
|||||||
|
2005-03-26 Martin Hawlisch <Martin.Hawlisch@gmx.de>
|
||||||
|
* src/plugins/Check.py: Add check for child handle in family, that
|
||||||
|
does no longer exist in database
|
||||||
|
|
||||||
2005-03-25 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
|
2005-03-25 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
|
||||||
* src/ScratchPad.py (ScratchPadWindow): moved content of pad to a
|
* src/ScratchPad.py (ScratchPadWindow): moved content of pad to a
|
||||||
class attribute so that it is preserved when the pad is closed.
|
class attribute so that it is preserved when the pad is closed.
|
||||||
|
@ -112,15 +112,21 @@ class CheckIntegrity:
|
|||||||
self.db.commit_person(mother,self.trans)
|
self.db.commit_person(mother,self.trans)
|
||||||
for child_handle in family.get_child_handle_list():
|
for child_handle in family.get_child_handle_list():
|
||||||
child = self.db.get_person_from_handle(child_handle)
|
child = self.db.get_person_from_handle(child_handle)
|
||||||
if family_handle == child.get_main_parents_family_handle():
|
if child:
|
||||||
continue
|
if family_handle == child.get_main_parents_family_handle():
|
||||||
for family_type in child.get_parent_family_handle_list():
|
continue
|
||||||
if family_type[0] == family_handle:
|
for family_type in child.get_parent_family_handle_list():
|
||||||
break
|
if family_type[0] == family_handle:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
family.remove_child_handle(child_handle)
|
||||||
|
self.db.commit_family(family,self.trans)
|
||||||
|
self.broken_links.append((child_handle,family_handle))
|
||||||
else:
|
else:
|
||||||
family.remove_child_handle(child_handle)
|
family.remove_child_handle(child_handle)
|
||||||
self.db.commit_family(family,self.trans)
|
self.db.commit_family(family,self.trans)
|
||||||
self.broken_links.append((child_handle,family_handle))
|
self.broken_links.append((child_handle,family_handle))
|
||||||
|
|
||||||
|
|
||||||
def cleanup_missing_photos(self,cl=0):
|
def cleanup_missing_photos(self,cl=0):
|
||||||
missmedia_action = 0
|
missmedia_action = 0
|
||||||
@ -301,7 +307,10 @@ class CheckIntegrity:
|
|||||||
for (person_handle,family_handle) in self.broken_links:
|
for (person_handle,family_handle) in self.broken_links:
|
||||||
person = self.db.get_person_from_handle(person_handle)
|
person = self.db.get_person_from_handle(person_handle)
|
||||||
family = self.db.get_family_from_handle(family_handle)
|
family = self.db.get_family_from_handle(family_handle)
|
||||||
cn = person.get_primary_name().get_name()
|
if person:
|
||||||
|
cn = person.get_primary_name().get_name()
|
||||||
|
else:
|
||||||
|
cn = _("Non existing child")
|
||||||
f = self.db.get_person_from_handle(family.get_father_handle())
|
f = self.db.get_person_from_handle(family.get_father_handle())
|
||||||
m = self.db.get_person_from_handle(family.get_mother_handle())
|
m = self.db.get_person_from_handle(family.get_mother_handle())
|
||||||
if f and m:
|
if f and m:
|
||||||
|
Loading…
Reference in New Issue
Block a user