def do_change_icon_source(realm: Realm, icon_source: str, log: bool=True) -> None:
    realm.icon_source = icon_source
    realm.icon_version += 1
    realm.save(update_fields=['icon_source', 'icon_version'])
    if log:
        log_event({'type': 'realm_change_icon', 'realm': realm.string_id, 'icon_source': icon_source})
    send_event(realm, dict(type='realm', op='update_dict', property='icon', data=dict(icon_source=realm.icon_source, icon_url=realm_icon_url(realm))), active_user_ids(realm.id))
def do_change_icon_source(realm: Realm, icon_source: str, log: bool=True) -> None:
    realm.icon_source = icon_source
    realm.icon_version += 1
    realm.save(update_fields=['icon_source', 'icon_version'])
    if log:
        log_event({'type': 'realm_change_icon', 'realm': realm.string_id, 'icon_source': icon_source})
    send_event(realm, dict(type='realm', op='update_dict', property='icon', data=dict(icon_source=realm.icon_source, icon_url=realm_icon_url(realm))), active_user_ids(realm.id))