(self, *args, **kwargs)
return response
Handle exception with transaction rollback.
Handle exception with transaction rollback.
Handle exception with transaction rollback .
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
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