6960: fix merging citations batch tool; sources
Back-port from gramps40 of r22971. svn: r22972
This commit is contained in:
@@ -31,7 +31,7 @@ Provide merge capabilities for citations.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.lib import (Person, Family, Event, Place,
|
||||
MediaObject, Repository, Citation)
|
||||
MediaObject, Repository, Citation, Source)
|
||||
from gen.db import DbTxn
|
||||
from gen.ggettext import sgettext as _
|
||||
import const
|
||||
@@ -232,6 +232,12 @@ class MergeCitationQuery(object):
|
||||
citation.replace_citation_references(old_handle,
|
||||
new_handle)
|
||||
self.database.commit_citation(citation, trans)
|
||||
elif class_name == Source.__name__:
|
||||
source = self.database.get_source_from_handle(handle)
|
||||
assert(source.has_citation_reference(old_handle))
|
||||
source.replace_citation_references(old_handle,
|
||||
new_handle)
|
||||
self.database.commit_source(source, trans)
|
||||
else:
|
||||
raise MergeError("Encounter an object of type %s that has "
|
||||
"a citation reference." % class_name)
|
||||
|
||||
Reference in New Issue
Block a user