2006-04-30 Don Allingham <don@gramps-project.org>

* src/RelLib/_Person.py: prevent duplicate entries in family lists



svn: r6500
This commit is contained in:
Don Allingham 2006-04-30 20:45:49 +00:00
parent 6d8c37f381
commit fd356770ce
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,6 @@
2006-04-30 Don Allingham <don@gramps-project.org>
* src/RelLib/_Person.py: prevent duplicate entries in family lists
2006-04-29 Don Allingham <don@gramps-project.org> 2006-04-29 Don Allingham <don@gramps-project.org>
* src/Editors/_EditFamily.py: fix Select Person calls * src/Editors/_EditFamily.py: fix Select Person calls
* src/docgen/Makefile.am: add ODSDoc.py * src/docgen/Makefile.am: add ODSDoc.py

View File

@ -590,7 +590,8 @@ class Person(PrimaryObject,SourceBase,NoteBase,MediaBase,
Person's L{Family} list. Person's L{Family} list.
@type family_handle: str @type family_handle: str
""" """
self.family_list.append(family_handle) if family_handle not in self.family_list:
self.family_list.append(family_handle)
def set_preferred_family_handle(self, family_handle): def set_preferred_family_handle(self, family_handle):
""" """
@ -691,7 +692,8 @@ class Person(PrimaryObject,SourceBase,NoteBase,MediaBase,
""" """
if type(family_handle) not in (str ,unicode ): if type(family_handle) not in (str ,unicode ):
raise ValueError("expecting handle") raise ValueError("expecting handle")
self.parent_family_list.append(family_handle) if family_handle not in self.parent_family_list:
self.parent_family_list.append(family_handle)
def clear_parent_family_handle_list(self): def clear_parent_family_handle_list(self):
""" """