def commit_on_success_unless_managed(using=None, savepoint=False):
 connection = get_connection(using)
 if (connection.get_autocommit() or connection.in_atomic_block):
  return atomic(using, savepoint)
 else:
  def entering(using):
   pass
  def exiting(exc_type, using):
   set_dirty(using=using)
  return _transaction_func(entering, exiting, using)

def commit_on_success_unless_managed ( using = None , savepoint = False ) : connection = get_connection ( using ) if ( connection . get_autocommit ( ) or connection . in_atomic_block ) : return atomic ( using , savepoint ) else : def entering ( using ) : pass def exiting ( exc_type , using ) : set_dirty ( using = using ) return _transaction_func ( entering , exiting , using )
transitory api to preserve backwards-compatibility while refactoring .