'Checks whether the transaction manager is in manual or in auto state.'

def is_managed(self):

    if self.transaction_state:
        return self.transaction_state[(-1)]
    return settings.TRANSACTIONS_MANAGED
