From 8516eb14161efa9330b347079c6a42a1e52a2f5f 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 --- src/RelLib.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/RelLib.py b/src/RelLib.py index e7216b02a..0e0cf2449 100644 --- a/src/RelLib.py +++ b/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"""