4198: Person view does not remove a row correctly when two people are merged.
This patch improves on the context changes: * avoid use of transaction_xx methods * force an abort in case of unclean transaction Backward compatibility is broken to achieve this. svn: r16680
This commit is contained in:
@@ -59,6 +59,7 @@ import Utils
|
||||
import Bookmarks
|
||||
import gen.mime
|
||||
import gen.lib
|
||||
from gen.db import DbTxn
|
||||
from gui.editors import EditMedia, DeleteMediaQuery
|
||||
import Errors
|
||||
from Filters.SideBar import MediaSidebarFilter
|
||||
@@ -206,8 +207,7 @@ class MediaView(ListView):
|
||||
basename = os.path.basename(name)
|
||||
(root, ext) = os.path.splitext(basename)
|
||||
photo.set_description(root)
|
||||
with self.dbstate.db.transaction_begin(_("Drag Media Object")
|
||||
) as trans:
|
||||
with DbTxn(_("Drag Media Object"), self.dbstate.db) as trans:
|
||||
self.dbstate.db.add_object(photo, trans)
|
||||
widget.emit_stop_by_name('drag_data_received')
|
||||
|
||||
|
@@ -47,6 +47,7 @@ import pango
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gen.lib
|
||||
from gen.db import DbTxn
|
||||
from gui.views.navigationview import NavigationView
|
||||
from gui.editors import EditPerson, EditFamily
|
||||
from gui.filtereditor import FilterEditor
|
||||
@@ -1500,8 +1501,7 @@ class RelationshipView(NavigationView):
|
||||
family = self.dbstate.db.get_family_from_handle(family_handle)
|
||||
family.add_child_ref(ref)
|
||||
|
||||
with self.dbstate.db.transaction_begin(_("Add Child to Family")
|
||||
) as trans:
|
||||
with DbTxn(_("Add Child to Family"), self.dbstate.db) as trans:
|
||||
#add parentref to child
|
||||
person.add_parent_family_handle(family_handle)
|
||||
#default relationship is used
|
||||
|
Reference in New Issue
Block a user