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:
@@ -51,6 +51,7 @@ from gui.utils import open_file_with_default_application
|
||||
from gui.dbguielement import DbGUIElement
|
||||
from gui.selectors import SelectorFactory
|
||||
import gen.lib
|
||||
from gen.db import DbTxn
|
||||
import Utils
|
||||
import ThumbNails
|
||||
import Errors
|
||||
@@ -476,8 +477,8 @@ class GalleryTab(ButtonTab, DbGUIElement):
|
||||
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)
|
||||
oref = gen.lib.MediaRef()
|
||||
oref.set_reference_handle(photo.get_handle())
|
||||
|
Reference in New Issue
Block a user