<s> from django . db . models . signals import post_save <EOL> from sellmo . apps . cart . signals import cart_changed <EOL> from sellmo . apps . customer . models import Customer <EOL> def on_customer_post_save ( sender , instance , raw = False , ** kwargs ) : <EOL> if not raw : <EOL> order = getattr ( instance , '<STR_LIT>' , None ) <EOL> if order is not None : <EOL> order . customer = instance <EOL> order . save ( ) <EOL> post_save . connect ( on_customer_post_save , sender = Customer ) <EOL> def on_cart_changed ( sender , cart , ** kwargs ) : <EOL> if hasattr ( cart , '<STR_LIT>' ) : <EOL> cart . order . invalidate ( ) <EOL> cart . order . calculate ( ) <EOL> cart . order . save ( ) <EOL> cart_changed . connect ( on_cart_changed ) </s>
