def on_success(handler, using=None):
connection = get_connection(using)<EOL>if getattr(connection, '<STR_LIT>', False):<EOL><INDENT>connection.transaction_signals_context_list[-<NUM_LIT:1>].register(handler)<EOL><DEDENT>else:<EOL><INDENT>if settings.DEBUG:<EOL><INDENT>logger.warning(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>)<EOL><DEDENT>handler()<EOL><DEDENT>
Register a handler or a function to be called after successful code pass.
If transaction signals are not active the handler/function is called immediately.
:param handler: handler or function that will be called.
:param using: name of the database