From c4195cf7eff44e3b8467f24c7f83afd4eecf39ef Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Mon, 30 May 2005 15:25:17 +0000 Subject: [PATCH] * src/src/GrampsBSDDB.py (upgrade_7): Handle case of not set default person svn: r4735 --- ChangeLog | 3 +++ src/GrampsBSDDB.py | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ea1d45234..529396ba2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2005-05-30 Martin Hawlisch + * src/src/GrampsBSDDB.py (upgrade_7): Handle case of not set default person + 2005-05-28 Alex Roitman * src/RelLib.py: Delegate event handle reference lookup from Person to EventRef class; (RepoRef.get_handle_referents): Remove diff --git a/src/GrampsBSDDB.py b/src/GrampsBSDDB.py index 0b9f4c0c1..39b5020a0 100644 --- a/src/GrampsBSDDB.py +++ b/src/GrampsBSDDB.py @@ -826,8 +826,12 @@ class GrampsBSDDB(GrampsDbBase): def upgrade_7(self): print "Upgrading to DB version 7" # First, make sure the stored default person handle is str, not unicode - handle = self.metadata['default'] - self.metadata['default'] = str(handle) + try: + handle = self.metadata['default'] + self.metadata['default'] = str(handle) + except KeyError: + # default person was not stored in database + pass trans = Transaction("",self) trans.set_batch(True) # Change every source to have reporef_list