mirror of https://github.com/zulip/zulip.git
invites: Allow users to invite without specifying any stream to join.
We now allow users to invite without specifying any stream to join. In such cases, the user would join the default streams, if any, during the process of account creation after accepting the invite. It is also fine if there are no default streams and user isn't subscribed to any stream initially.
This commit is contained in:
parent
875bcb183e
commit
4ca887bade
|
@ -20,6 +20,12 @@ format used by the Zulip server that they are interacting with.
|
|||
|
||||
## Changes in Zulip 7.0
|
||||
|
||||
**Feature level 180**
|
||||
|
||||
* `POST /invites`: Added support for invitations specifying the empty
|
||||
list as the user's initial stream subscriptions. Previously, this
|
||||
returned an error.
|
||||
|
||||
**Feature level 179**:
|
||||
|
||||
* [`POST /scheduled_messages`](/api/create-or-update-scheduled-message):
|
||||
|
|
|
@ -33,7 +33,7 @@ DESKTOP_WARNING_VERSION = "5.4.3"
|
|||
# Changes should be accompanied by documentation explaining what the
|
||||
# new level means in api_docs/changelog.md, as well as "**Changes**"
|
||||
# entries in the endpoint's documentation in `zulip.yaml`.
|
||||
API_FEATURE_LEVEL = 179
|
||||
API_FEATURE_LEVEL = 180
|
||||
|
||||
# Bump the minor PROVISION_VERSION to indicate that folks should provision
|
||||
# only when going from an old version of the code to a newer version. Bump
|
||||
|
|
|
@ -260,9 +260,8 @@ function open_invite_user_modal(e) {
|
|||
function toggle_invite_submit_button() {
|
||||
$("#invite-user-modal .dialog_submit_button").prop(
|
||||
"disabled",
|
||||
($("#invitee_emails").val().trim() === "" &&
|
||||
!$("#generate_multiuse_invite_radio").is(":checked")) ||
|
||||
$("#streams_to_add input:checked").length === 0,
|
||||
$("#invitee_emails").val().trim() === "" &&
|
||||
!$("#generate_multiuse_invite_radio").is(":checked"),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -326,10 +325,6 @@ function open_invite_user_modal(e) {
|
|||
|
||||
$("#invite_uncheck_all_button").on("click", () => {
|
||||
$("#streams_to_add input[type=checkbox]").prop("checked", false);
|
||||
$("#invite-user-modal .dialog_submit_button").prop(
|
||||
"disabled",
|
||||
!$("#generate_multiuse_invite_radio").is(":checked"),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -704,6 +704,18 @@ class InviteUserTest(InviteUserBase):
|
|||
self.submit_reg_form_for_user(invitee, "password")
|
||||
self.check_user_subscribed_only_to_streams("alice", streams)
|
||||
|
||||
invitee = self.nonreg_email("bob")
|
||||
self.assert_json_success(self.invite(invitee, []))
|
||||
self.assertTrue(find_key_by_email(invitee))
|
||||
|
||||
default_streams = get_default_streams_for_realm(realm.id)
|
||||
self.assert_length(default_streams, 1)
|
||||
|
||||
self.submit_reg_form_for_user(invitee, "password")
|
||||
# If no streams are provided, user is not subscribed to
|
||||
# default streams as well.
|
||||
self.check_user_subscribed_only_to_streams("bob", [])
|
||||
|
||||
def test_can_invite_others_to_realm(self) -> None:
|
||||
def validation_func(user_profile: UserProfile) -> bool:
|
||||
user_profile.refresh_from_db()
|
||||
|
@ -921,11 +933,6 @@ earl-test@zulip.com""",
|
|||
do_set_realm_property(realm, "emails_restricted_to_domains", True, acting_user=None)
|
||||
|
||||
self.login("hamlet")
|
||||
invitee_emails = "foo@zulip.com"
|
||||
self.assert_json_error(
|
||||
self.invite(invitee_emails, []),
|
||||
"You must specify at least one stream for invitees to join.",
|
||||
)
|
||||
|
||||
for address in ("noatsign.com", "outsideyourdomain@example.net"):
|
||||
self.assert_json_error(
|
||||
|
|
|
@ -70,8 +70,6 @@ def invite_users_backend(
|
|||
raise JsonableError(_("Must be an organization administrator"))
|
||||
if not invitee_emails_raw:
|
||||
raise JsonableError(_("You must specify at least one email address."))
|
||||
if not stream_ids:
|
||||
raise JsonableError(_("You must specify at least one stream for invitees to join."))
|
||||
|
||||
invitee_emails = get_invitee_emails_set(invitee_emails_raw)
|
||||
|
||||
|
|
Loading…
Reference in New Issue