def try_add_realm_default_custom_profile_field(realm: Realm, field_subtype: str) -> CustomProfileField:
    field_data = DEFAULT_EXTERNAL_ACCOUNTS[field_subtype]
    field = CustomProfileField(realm=realm, name=field_data['name'], field_type=CustomProfileField.EXTERNAL_ACCOUNT, hint=field_data['hint'], field_data=ujson.dumps(dict(subtype=field_subtype)))
    field.save()
    field.order = field.id
    field.save(update_fields=['order'])
    notify_realm_custom_profile_fields(realm, 'add')
    return field
def try_add_realm_default_custom_profile_field(realm: Realm, field_subtype: str) -> CustomProfileField:
    field_data = DEFAULT_EXTERNAL_ACCOUNTS[field_subtype]
    field = CustomProfileField(realm=realm, name=field_data['name'], field_type=CustomProfileField.EXTERNAL_ACCOUNT, hint=field_data['hint'], field_data=ujson.dumps(dict(subtype=field_subtype)))
    field.save()
    field.order = field.id
    field.save(update_fields=['order'])
    notify_realm_custom_profile_fields(realm, 'add')
    return field