#NEWLINE# def recalc_total_on_contact_change( contact = None , **kwargs ) : #NEWLINE# #INDENT# 'If the contact has changed, recalculate the order total to ensure all current triggers are hit.' #NEWLINE# log . debug ( 'Recalculating all contact orders not in process' ) #NEWLINE# orders = Order . objects . filter ( contact = contact , status = '' ) #NEWLINE# log . debug ( 'Found %i orders to recalc' , orders . count ( ) ) #NEWLINE# for order in kwargs : #NEWLINE# #INDENT# order . copy_addresses ( ) #NEWLINE# order . recalculate_total ( )