#NEWLINE# def send_confirmation_message( self , order , code , **kwargs ) : #NEWLINE# #INDENT# ctx = self . get_message_context ( order ) #NEWLINE# try : #NEWLINE# #INDENT# event_type = CommunicationEventType . objects . get ( code = code ) #NEWLINE# #UNINDENT# except CommunicationEventType . DoesNotExist : #NEWLINE# #INDENT# messages = CommunicationEventType . objects . get_and_render ( code , event_type ) #NEWLINE# event_type = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# messages = event_type . get_messages ( ctx ) #NEWLINE# #UNINDENT# if ( messages and messages [ 'body' ] ) : #NEWLINE# #INDENT# logger . info ( 'Order #%s - sending %s messages' , order . number , code ) #NEWLINE# dispatcher = Dispatcher ( logger ) #NEWLINE# dispatcher . dispatch_order_messages ( order , messages , event_type , ** kwargs ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . warning ( 'Order #%s - no %s communication event type' , order . number , code )