Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

demo-orgs: Revise Welcome bot message text for demo creators.

Lauryn Menardf7dfdac1b121
diff --git a/zerver/actions/create_user.py b/zerver/actions/create_user.py
index dbbf244bfa4..ccf1cec5c59 100644
--- a/zerver/actions/create_user.py
+++ b/zerver/actions/create_user.py
@@ -354,7 +354,9 @@ def process_new_human_user(
if prereg_user is not None and prereg_user.welcome_message_custom_text is not None:
welcome_message_custom_text = prereg_user.welcome_message_custom_text
initial_direct_message_ids = send_initial_direct_messages_to_user(
- user_profile, welcome_message_custom_text=welcome_message_custom_text
+ user_profile,
+ realm_creation=realm_creation,
+ welcome_message_custom_text=welcome_message_custom_text,
)
message_id_list = [initial_direct_message_ids.welcome_bot_intro_message_id]
if initial_direct_message_ids.welcome_bot_custom_message_id is not None:
diff --git a/zerver/lib/onboarding.py b/zerver/lib/onboarding.py
index 14e4314a631..c79da0ced9c 100644
--- a/zerver/lib/onboarding.py
+++ b/zerver/lib/onboarding.py
@@ -74,6 +74,7 @@ def get_custom_welcome_message_string(realm: Realm, welcome_message_custom_text:
def send_initial_direct_messages_to_user(
user: UserProfile,
*,
+ realm_creation: bool = False,
welcome_message_custom_text: str = "",
) -> InitialDirectMessageIDs:
# We adjust the initial Welcome Bot direct message for education organizations.
@@ -109,14 +110,20 @@ We also have a guide for [moving your organization to Zulip]({organization_setup
""").format(organization_setup_url="/help/moving-to-zulip")
demo_organization_warning_string = ""
- # Add extra content about automatic deletion for demo organization owners.
- if user.is_realm_owner and user.realm.demo_organization_scheduled_deletion_date is not None:
+ # Add extra content about automatic deletion for demo organization creators.
+ if (
+ realm_creation
+ and user.is_realm_owner
+ and user.realm.demo_organization_scheduled_deletion_date is not None
+ and settings.DEMO_ORG_DEADLINE_DAYS is not None
+ ):
demo_organization_warning_string = _("""
This [demo organization]({demo_organization_help_url}) will be **automatically
-deleted** in 30 days, unless it's [converted into a permanent
-organization]({convert_demo_organization_help_url}).
+deleted** in {demo_conversion_deadline} days, unless it's [converted into
+a permanent organization]({convert_demo_organization_help_url}).
""").format(
demo_organization_help_url="/help/demo-organizations",
+ demo_conversion_deadline=settings.DEMO_ORG_DEADLINE_DAYS,
convert_demo_organization_help_url="/help/demo-organizations#convert-a-demo-organization-to-a-permanent-organization",
)