5690: Can create multiple events with same Gramps-ID
This commit is contained in:
parent
ce9753fe99
commit
89d6a819d7
@ -244,13 +244,12 @@ class EditEventRef(EditReference):
|
||||
|
||||
def ok_clicked(self, obj):
|
||||
|
||||
if self.check_for_duplicate_id('Event'):
|
||||
return
|
||||
|
||||
if self.source.handle:
|
||||
with DbTxn(_("Modify Event"), self.db) as trans:
|
||||
self.commit_event(self.source,trans)
|
||||
else:
|
||||
if self.check_for_duplicate_id('Event'):
|
||||
return
|
||||
with DbTxn(_("Add Event"), self.db) as trans:
|
||||
self.add_event(self.source,trans)
|
||||
self.source_ref.ref = self.source.handle
|
||||
|
@ -656,15 +656,14 @@ class EditMediaRef(EditReference):
|
||||
|
||||
def save(self,*obj):
|
||||
|
||||
if self.check_for_duplicate_id('Media'):
|
||||
return
|
||||
|
||||
#first save primary object
|
||||
if self.source.handle:
|
||||
with DbTxn(_("Edit Media Object (%s)") %
|
||||
self.source.get_description(), self.db) as trans:
|
||||
self.db.commit_media_object(self.source, trans)
|
||||
else:
|
||||
if self.check_for_duplicate_id('Media'):
|
||||
return
|
||||
with DbTxn(_("Add Media Object (%s)") %
|
||||
self.source.get_description(), self.db) as trans:
|
||||
self.db.add_object(self.source, trans)
|
||||
|
@ -190,13 +190,12 @@ class EditRepoRef(EditReference):
|
||||
|
||||
def ok_clicked(self, obj):
|
||||
|
||||
if self.check_for_duplicate_id('Repository'):
|
||||
return
|
||||
|
||||
if self.source.handle:
|
||||
with DbTxn(_("Modify Repository"), self.db) as trans:
|
||||
self.db.commit_repository(self.source,trans)
|
||||
else:
|
||||
if self.check_for_duplicate_id('Repository'):
|
||||
return
|
||||
with DbTxn(_("Add Repository"), self.db) as trans:
|
||||
self.db.add_repository(self.source,trans)
|
||||
self.source_ref.ref = self.source.handle
|
||||
|
Loading…
Reference in New Issue
Block a user