#NEWLINE# def add_metadata( sms , message_bank_messages ) : #NEWLINE# #INDENT# '\n    sms - an instance of SMS\n    message_bank_messages - the result from calling get_message_bank(for_comparing=True)\n    ' #NEWLINE# text = letters_only ( sms . text ) #NEWLINE# for entry in message_bank_messages : #NEWLINE# #INDENT# if ( entry [ 'compare_string' ] in text ) : #NEWLINE# #INDENT# sms . fri_message_bank_message_id = entry [ 'message' ] . _id #NEWLINE# sms . fri_id = entry [ 'message' ] . fri_id #NEWLINE# sms . fri_risk_profile = entry [ 'message' ] . risk_profile #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# sms . fri_message_bank_lookup_completed = True #NEWLINE# try : #NEWLINE# #INDENT# sms . save ( ) #NEWLINE# sms . publish_change ( ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# pass