#NEWLINE# @ receiver ( basket_addition ) #NEWLINE# def receive_basket_addition( sender , product , user , **kwargs ) : #NEWLINE# #INDENT# if kwargs . get ( 'raw' , False ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# _update_counter ( ProductRecord , 'num_basket_additions' , { #NEWLINE# #INDENT# 'product' : product , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( user and user . is_authenticated ( ) ) : #NEWLINE# #INDENT# _update_counter ( UserRecord , 'num_basket_additions' , { #NEWLINE# #INDENT# 'user' : user , #NEWLINE# #UNINDENT# } )