2008-02-07 Raphael Ackermann <raphael.ackermann@gmail.com>

* src/Editors/_EditEvent.py:
    * src/Editors/_EditFamily.py:
    * src/Editors/_EditMedia.py:
    * src/Editors/_EditNote.py:
    * src/Editors/_EditPerson.py:
    * src/Editors/_EditPlace.py:
    * src/Editors/_EditPrimary.py:
    * src/Editors/_EditRepository.py:
    * src/Editors/_EditSource.py:
    0001745: fix where on update empty ID field would not be filled 
    automatically

svn: r10004
This commit is contained in:
Raphael Ackermann
2008-02-08 13:40:04 +00:00
parent beb3b62518
commit 6776b91ca5
10 changed files with 74 additions and 37 deletions

View File

@@ -220,14 +220,16 @@ class EditEvent(EditPrimary):
self.ok_button.set_sensitive(True)
return
if self.obj.handle == None:
if not self.obj.handle:
trans = self.db.transaction_begin()
self.db.add_event(self.obj,trans)
self.db.transaction_commit(trans,_("Add Event"))
self.db.add_event(self.obj, trans)
self.db.transaction_commit(trans, _("Add Event"))
else:
orig = self.dbstate.db.get_event_from_handle(self.obj.handle)
orig = self.get_from_handle(self.obj.handle)
if cmp(self.obj.serialize(),orig.serialize()):
trans = self.db.transaction_begin()
if not self.obj.get_gramps_id():
self.obj.set_gramps_id(self.db.find_next_event_gramps_id())
self.commit_event(self.obj,trans)
self.db.transaction_commit(trans,_("Edit Event"))