From f04fa820d439513de6a2c55bb097c7fde12d6806 Mon Sep 17 00:00:00 2001 From: John Dennis Date: Oct 10 2015 21:23:06 +0000 Subject: Transaction object must always have a transaction id A Transaction object must always have a transaction id (tid) because a tid is how a transaction is referenced (e.g. when being stored or retrieved). The existing code erroneously assumed a tid only needed to be created if the request contained query or form parameters. This restriction is now removed, if the transaction id cannot be found as a request parameter a tid is unconditionally created. Ticket: 177 Signed-off-by: John Dennis Reviewed-by: Patrick Uiterwijk --- diff --git a/ipsilon/util/trans.py b/ipsilon/util/trans.py index bcc3bd0..22c7641 100644 --- a/ipsilon/util/trans.py +++ b/ipsilon/util/trans.py @@ -18,12 +18,12 @@ class Transaction(Log): self._ts = TranStore() self.cookie = None - # Backwards compat, - # if arguments are passed find or get new transaction if kwargs: self.find_tid(kwargs) - if not self.transaction_id: - self.create_tid() + + # If tid isn't found create a new one + if not self.transaction_id: + self.create_tid() def find_tid(self, kwargs): tid = kwargs.get(TRANSID)