Protections for readonly databases

svn: r15500
This commit is contained in:
Doug Blank 2010-05-29 20:19:22 +00:00
parent 34c7efe804
commit 1b3e2aa09f
2 changed files with 7 additions and 5 deletions

View File

@ -82,8 +82,9 @@ class EditEventRef(EditReference):
_('_General'), tblref) _('_General'), tblref)
def _init_event(self): def _init_event(self):
self.commit_event = self.db.commit_personal_event if not self.db.readonly:
self.add_event = self.db.add_person_event self.commit_event = self.db.commit_personal_event
self.add_event = self.db.add_person_event
def get_custom_events(self): def get_custom_events(self):
return self.db.get_person_event_types() return self.db.get_person_event_types()
@ -257,8 +258,9 @@ class EditFamilyEventRef(EditEventRef):
event_ref, update) event_ref, update)
def _init_event(self): def _init_event(self):
self.commit_event = self.db.commit_family_event if not self.db.readonly:
self.add_event = self.db.add_family_event self.commit_event = self.db.commit_family_event
self.add_event = self.db.add_family_event
def get_custom_events(self): def get_custom_events(self):
return [ gen.lib.EventType((gen.lib.EventType.CUSTOM,val)) \ return [ gen.lib.EventType((gen.lib.EventType.CUSTOM,val)) \

View File

@ -214,7 +214,7 @@ class EditName(EditSecondary):
self.obj.set_surname, self.obj.set_surname,
self.obj.get_surname, self.obj.get_surname,
self.db.readonly, self.db.readonly,
autolist=self.db.get_surname_list(), autolist=self.db.get_surname_list() if not self.db.readonly else [],
changed=self.update_group_as) changed=self.update_group_as)
self.prefix_field = MonitoredEntry( self.prefix_field = MonitoredEntry(