From 4aba6b9fe68c4f22d97ef495eecca95e9e85fdd4 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 4 Sep 2003 03:51:58 +0000 Subject: [PATCH] * src/RelLib.py: select the lowest ID for the default person if the default person is not set svn: r2089 --- gramps2/src/RelLib.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gramps2/src/RelLib.py b/gramps2/src/RelLib.py index e7216b02a..0e0cf2449 100644 --- a/gramps2/src/RelLib.py +++ b/gramps2/src/RelLib.py @@ -2299,7 +2299,15 @@ class GrampsDB(Persistent): def getDefaultPerson(self): """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): """returns a map of gramps's IDs to Person instances"""