Subject: changeset in trytond:4.2 Remove actual stopped self from the 
transactions stack
From: Cédric Krier <[email protected]>

changeset 456d4f18f424 in trytond:4.2
details: https://hg.tryton.org/trytond?cmd=changeset;node=456d4f18f424
description:
        Remove actual stopped self from the transactions stack

        Stopping non-current transaction should not remove the last transaction 
but
        the last itself.

        issue7973
        review45861002
        (grafted from 677c4fc1c843232ab31a05b24ed8c1c17601ff78)
diffstat:

 trytond/transaction.py |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (17 lines):

diff -r 6c96940a1ad2 -r 456d4f18f424 trytond/transaction.py
--- a/trytond/transaction.py    Tue Jan 15 00:02:19 2019 +0100
+++ b/trytond/transaction.py    Thu Jan 17 17:13:26 2019 +0100
@@ -130,8 +130,11 @@
                     self.timestamp = None
                     self._datamanagers = []
         finally:
-            current_instance = transactions.pop()
-        assert current_instance is self, transactions
+            transactions.reverse()
+            try:
+                transactions.remove(self)
+            finally:
+                transactions.reverse()
 
     def set_context(self, context=None, **kwargs):
         if context is None:

Reply via email to