def do_create_multiuse_invite_link(referred_by: UserProfile, invited_as: int, streams: Sequence[Stream]=[]) -> str:
    realm = referred_by.realm
    invite = MultiuseInvite.objects.create(realm=realm, referred_by=referred_by)
    if streams:
        invite.streams.set(streams)
    invite.invited_as = invited_as
    invite.save()
    notify_invites_changed(referred_by)
    return create_confirmation_link(invite, Confirmation.MULTIUSE_INVITE)
def do_create_multiuse_invite_link(referred_by: UserProfile, invited_as: int, streams: Sequence[Stream]=[]) -> str:
    realm = referred_by.realm
    invite = MultiuseInvite.objects.create(realm=realm, referred_by=referred_by)
    if streams:
        invite.streams.set(streams)
    invite.invited_as = invited_as
    invite.save()
    notify_invites_changed(referred_by)
    return create_confirmation_link(invite, Confirmation.MULTIUSE_INVITE)