* src/RelLib.py: select the lowest ID for the default person

if the default person is not set


svn: r2089
This commit is contained in:
Don Allingham 2003-09-04 03:51:58 +00:00
parent a47edf4cf0
commit 8516eb1416

View File

@ -2299,7 +2299,15 @@ class GrampsDB(Persistent):
def getDefaultPerson(self): def getDefaultPerson(self):
"""returns the default Person of the database""" """returns the default Person of the database"""
return self.default if self.default == None:
keys = self.personTable.keys()
if len(keys):
keys.sort()
return self.personMap[keys[0]]
else:
return None
else:
return self.default
def getPerson(self,id): def getPerson(self,id):
"""returns a map of gramps's IDs to Person instances""" """returns a map of gramps's IDs to Person instances"""