def do_update_user_custom_profile_data_if_changed(user_profile: UserProfile, data: List[Dict[(str, Union[(int, str, List[int])])]]) -> None:
    with transaction.atomic():
        for field in data:
            (field_value, created) = CustomProfileFieldValue.objects.get_or_create(user_profile=user_profile, field_id=field['id'])
            if ((not created) and (field_value.value == str(field['value']))):
                continue
            field_value.value = field['value']
            if field_value.field.is_renderable():
                field_value.rendered_value = render_stream_description(str(field['value']))
                field_value.save(update_fields=['value', 'rendered_value'])
            else:
                field_value.save(update_fields=['value'])
            notify_user_update_custom_profile_data(user_profile, {'id': field_value.field_id, 'value': field_value.value, 'rendered_value': field_value.rendered_value, 'type': field_value.field.field_type})
def do_update_user_custom_profile_data_if_changed(user_profile: UserProfile, data: List[Dict[(str, Union[(int, str, List[int])])]]) -> None:
    with transaction.atomic():
        for field in data:
            (field_value, created) = CustomProfileFieldValue.objects.get_or_create(user_profile=user_profile, field_id=field['id'])
            if ((not created) and (field_value.value == str(field['value']))):
                continue
            field_value.value = field['value']
            if field_value.field.is_renderable():
                field_value.rendered_value = render_stream_description(str(field['value']))
                field_value.save(update_fields=['value', 'rendered_value'])
            else:
                field_value.save(update_fields=['value'])
            notify_user_update_custom_profile_data(user_profile, {'id': field_value.field_id, 'value': field_value.value, 'rendered_value': field_value.rendered_value, 'type': field_value.field.field_type})