#NEWLINE# def record_bill_proposal( **kwargs ) : #NEWLINE# #INDENT# if ( kwargs [ 'action' ] != 'post_add' ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# private_proposal_ct = ContentType . objects . get ( app_label = 'laws' , model = 'privateproposal' ) #NEWLINE# member_ct = ContentType . objects . get ( app_label = 'mks' , model = 'member' ) #NEWLINE# proposal = kwargs [ 'instance' ] #NEWLINE# if ( str ( kwargs [ 'sender' ] ) . find ( 'proposers' ) >= 0 ) : #NEWLINE# #INDENT# verb = 'proposed' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# verb = 'joined' #NEWLINE# #UNINDENT# for mk_id in kwargs [ 'pk_set' ] : #NEWLINE# #INDENT# if ( Action . objects . filter ( actor_object_id = mk_id , actor_content_type = member_ct , verb = verb , target_object_id = proposal . id , target_content_type = private_proposal_ct ) . count ( ) == 0 ) : #NEWLINE# #INDENT# mk = Member . objects . get ( pk = mk_id ) #NEWLINE# action . send ( mk , verb = verb , target = proposal , timestamp = proposal . date )