2006-05-08 Alex Roitman <shura@gramps-project.org>

* src/GrampsDb/_GrampsDbBase.py (get_default_person): Use proper
	way of getting person from the handle.



svn: r6592
This commit is contained in:
Alex Roitman 2006-05-09 04:33:21 +00:00
parent 2a7a35a259
commit 13ea348bdf
2 changed files with 9 additions and 10 deletions

View File

@ -1,3 +1,7 @@
2006-05-08 Alex Roitman <shura@gramps-project.org>
* src/GrampsDb/_GrampsDbBase.py (get_default_person): Use proper
way of getting person from the handle.
2006-05-08 Don Allingham <don@gramps-project.org> 2006-05-08 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_GrampsDbBase.py: get_default_handle() * src/GrampsDb/_GrampsDbBase.py: get_default_handle()
* src/DisplayState.py: use get_default_handle, fix race condition * src/DisplayState.py: use get_default_handle, fix race condition

View File

@ -1518,16 +1518,11 @@ class GrampsDbBase(GrampsDBCallback):
def get_default_person(self): def get_default_person(self):
"""returns the default Person of the database""" """returns the default Person of the database"""
if self.metadata: person = self.get_person_from_handle(self.get_default_handle())
key = self.metadata.get('default') if person:
data = self.person_map.get(key) return person
if data: elif (self.metadata) and (not self.readonly):
person = Person() self.metadata['default'] = None
person.unserialize(data)
return person
elif not self.readonly:
self.metadata['default'] = None
return None
return None return None
def get_default_handle(self): def get_default_handle(self):