parameters: (self, *args, **kwargs)
return_statement: return response
docstring: Handle exception with transaction rollback.
docstring_summary: Handle exception with transaction rollback.
docstring_tokens: Handle exception with transaction rollback .
function: def handle_exception(self, *args, **kwargs):
          """Handle exception with transaction rollback."""
          response = super(AtomicMixin, self).handle_exception(*args, **kwargs)
  
          if getattr(response, 'exception'):
              # We've suppressed the exception but still need to rollback any transaction.
              transaction.set_rollback(True)
  
          return response
function_tokens: def handle_exception ( self , * args , * * kwargs ) : response = super ( AtomicMixin , self ) . handle_exception ( * args , * * kwargs ) if getattr ( response , 'exception' ) : # We've suppressed the exception but still need to rollback any transaction. transaction . set_rollback ( True ) return response