#NEWLINE# def post( self , request , * args , **kwargs ) : #NEWLINE# #INDENT# if ( self . async_response is not None ) : #NEWLINE# #INDENT# return self . async_response #NEWLINE# #UNINDENT# if self . trigger_form . is_valid ( ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . trigger_form . trigger_invoice ( ) #NEWLINE# messages . success ( request , ( 'Successfully triggered invoices for domain %s.' % self . trigger_form . cleaned_data [ 'domain' ] ) ) #NEWLINE# return HttpResponseRedirect ( reverse ( self . urlname ) ) #NEWLINE# #UNINDENT# except ( CreditLineError , InvoiceError ) as e : #NEWLINE# #INDENT# messages . error ( request , ( 'Error generating invoices: %s' % e ) , extra_tags = 'html' ) #NEWLINE# #UNINDENT# #UNINDENT# return self . get ( request , * args , ** kwargs )