#NEWLINE# def form_valid( self , form ) : #NEWLINE# #INDENT# account = self . object #NEWLINE# amount = form . cleaned_data [ 'amount' ] #NEWLINE# try : #NEWLINE# #INDENT# facade . transfer ( account , form . get_source_account ( ) , amount , user = self . request . user , description = _ ( 'Return funds to source account' ) ) #NEWLINE# #UNINDENT# except exceptions . AccountException as e : #NEWLINE# #INDENT# messages . error ( self . request , ( _ ( 'Unable to withdraw funds from account: %s' ) % amount ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# messages . success ( self . request , ( _ ( '%s withdrawn from account' ) % currency ( amount ) ) ) #NEWLINE# #UNINDENT# return http . HttpResponseRedirect ( reverse ( 'accounts-detail' , kwargs = { #NEWLINE# #INDENT# 'pk' : account . id , #NEWLINE# #UNINDENT# } ) )