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 <jdennis@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
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)