def do_change_full_name(user_profile: UserProfile, full_name: str, acting_user: Optional[UserProfile]) -> None:
    old_name = user_profile.full_name
    user_profile.full_name = full_name
    user_profile.save(update_fields=['full_name'])
    event_time = timezone_now()
    RealmAuditLog.objects.create(realm=user_profile.realm, acting_user=acting_user, modified_user=user_profile, event_type=RealmAuditLog.USER_FULL_NAME_CHANGED, event_time=event_time, extra_data=old_name)
    payload = dict(user_id=user_profile.id, full_name=user_profile.full_name)
    send_event(user_profile.realm, dict(type='realm_user', op='update', person=payload), active_user_ids(user_profile.realm_id))
    if user_profile.is_bot:
        send_event(user_profile.realm, dict(type='realm_bot', op='update', bot=payload), bot_owner_user_ids(user_profile))
def do_change_full_name(user_profile: UserProfile, full_name: str, acting_user: Optional[UserProfile]) -> None:
    old_name = user_profile.full_name
    user_profile.full_name = full_name
    user_profile.save(update_fields=['full_name'])
    event_time = timezone_now()
    RealmAuditLog.objects.create(realm=user_profile.realm, acting_user=acting_user, modified_user=user_profile, event_type=RealmAuditLog.USER_FULL_NAME_CHANGED, event_time=event_time, extra_data=old_name)
    payload = dict(user_id=user_profile.id, full_name=user_profile.full_name)
    send_event(user_profile.realm, dict(type='realm_user', op='update', person=payload), active_user_ids(user_profile.realm_id))
    if user_profile.is_bot:
        send_event(user_profile.realm, dict(type='realm_bot', op='update', bot=payload), bot_owner_user_ids(user_profile))