Readonly databases do not necessarily have commit methods

svn: r15460
This commit is contained in:
Doug Blank 2010-05-23 15:00:48 +00:00
parent 7c4d945da6
commit ed73f393ed

View File

@ -77,7 +77,8 @@ class EditEvent(EditPrimary):
self._init_event()
def _init_event(self):
self.commit_event = self.db.commit_event
if not self.db.readonly:
self.commit_event = self.db.commit_event
def empty_object(self):
return gen.lib.Event()
@ -302,7 +303,8 @@ class EditPersonEvent(EditEvent):
EditEvent.__init__(self, dbstate, uistate, track, event, callback)
def _init_event(self):
self.commit_event = self.db.commit_personal_event
if not self.db.readonly:
self.commit_event = self.db.commit_personal_event
def get_custom_events(self):
return self.dbstate.db.get_person_event_types()
@ -313,7 +315,8 @@ class EditFamilyEvent(EditEvent):
EditEvent.__init__(self, dbstate, uistate, track, event, callback)
def _init_event(self):
self.commit_event = self.db.commit_family_event
if not self.db.readonly:
self.commit_event = self.db.commit_family_event
def get_custom_events(self):
return self.dbstate.db.get_family_event_types()