def emit_setting_changed_event(user, db_table, setting_name, old_value, new_value):
 truncated_fields = truncate_fields(old_value, new_value)
 truncated_fields['setting'] = setting_name
 truncated_fields['user_id'] = user.id
 truncated_fields['table'] = db_table
 tracker.emit(USER_SETTINGS_CHANGED_EVENT_NAME, truncated_fields)
 USER_FIELD_CHANGED.send(sender=None, user=user, table=db_table, setting=setting_name, old_value=old_value, new_value=new_value)

def emit_setting_changed_event ( user , db_table , setting_name , old_value , new_value ) : truncated_fields = truncate_fields ( old_value , new_value ) truncated_fields [ 'setting' ] = setting_name truncated_fields [ 'user_id' ] = user . id truncated_fields [ 'table' ] = db_table tracker . emit ( USER_SETTINGS_CHANGED_EVENT_NAME , truncated_fields ) USER_FIELD_CHANGED . send ( sender = None , user = user , table = db_table , setting = setting_name , old_value = old_value , new_value = new_value )
emits an event for a change in a setting .