From 8ce63889c54a63c5b68e31c7685a2dbbcf4578e4 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Thu, 14 Dec 2006 06:38:07 +0000 Subject: [PATCH] 2006-12-13 Alex Roitman * src/GrampsDb/_GrampsDbBase.py (_set_column_order): Correctly check for metadata being None. svn: r7798 --- gramps2/ChangeLog | 4 ++++ gramps2/src/GrampsDb/_GrampsDbBase.py | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index b71fd5b3c..f96ec12a6 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2006-12-13 Alex Roitman + * src/GrampsDb/_GrampsDbBase.py (_set_column_order): Correctly + check for metadata being None. + 2006-12-13 Richard Taylor * test/GrampsDb/GrampsDbBase_Test.py: fix test case to work with reindex_reference_map diff --git a/gramps2/src/GrampsDb/_GrampsDbBase.py b/gramps2/src/GrampsDb/_GrampsDbBase.py index 1b1af31ef..470685088 100644 --- a/gramps2/src/GrampsDb/_GrampsDbBase.py +++ b/gramps2/src/GrampsDb/_GrampsDbBase.py @@ -1609,7 +1609,7 @@ class GrampsDbBase(GrampsDBCallback): def set_default_person_handle(self, handle): """sets the default Person to the passed instance""" - if not self.readonly: + if (self.metadata != None) and (not self.readonly): self.metadata['default'] = str(handle) def get_default_person(self): @@ -1617,13 +1617,13 @@ class GrampsDbBase(GrampsDBCallback): person = self.get_person_from_handle(self.get_default_handle()) if person: return person - elif (self.metadata) and (not self.readonly): + elif (self.metadata != None) and (not self.readonly): self.metadata['default'] = None return None def get_default_handle(self): """returns the default Person of the database""" - if self.metadata: + if self.metadata != None: return self.metadata.get('default') return None @@ -1875,7 +1875,7 @@ class GrampsDbBase(GrampsDBCallback): return locale.strcoll(media1, media2) def _set_column_order(self, col_list, name): - if self.metadata and not self.readonly: + if (self.metadata != None) and (not self.readonly): self.metadata[name] = col_list def set_person_column_order(self, col_list):