register: Add AI/LLM as option for how user found Zulip.

This commit is contained in:
Aman Agrawal
2025-09-24 12:02:39 +05:30
committed by Tim Abbott
parent c6bf35b392
commit 40f4ad2cb0
6 changed files with 8 additions and 0 deletions

View File

@@ -255,6 +255,7 @@ def realm_summary_table(export: bool) -> str:
RealmAuditLog.HOW_REALM_CREATOR_FOUND_ZULIP_OPTIONS["other"],
RealmAuditLog.HOW_REALM_CREATOR_FOUND_ZULIP_OPTIONS["ad"],
RealmAuditLog.HOW_REALM_CREATOR_FOUND_ZULIP_OPTIONS["review_site"],
RealmAuditLog.HOW_REALM_CREATOR_FOUND_ZULIP_OPTIONS["ai_chatbot"],
):
row["how_realm_creator_found_zulip"] += f": {extra_context}"
elif how_found == RealmAuditLog.HOW_REALM_CREATOR_FOUND_ZULIP_OPTIONS["existing_user"]:

View File

@@ -214,6 +214,7 @@ Form is validated both client-side using jquery-validation (see signup.js) and s
<input id="how-realm-creator-found-zulip-where-ad" class="how-found-zulip-extra-data-input" type="text" placeholder="{{ _('Where did you see the ad?') }}" name="how_realm_creator_found_zulip_where_ad" maxlength="100"/>
<input id="how-realm-creator-found-zulip-which-organization" class="how-found-zulip-extra-data-input" type="text" placeholder="{{ _('Which organization?') }}" name="how_realm_creator_found_zulip_which_organization" maxlength="100"/>
<input id="how-realm-creator-found-zulip-review-site" class="how-found-zulip-extra-data-input" type="text" placeholder="{{ _('Which one?') }}" name="how_realm_creator_found_zulip_review_site" maxlength="100"/>
<input id="how-realm-creator-found-zulip-which-ai-chatbot" class="how-found-zulip-extra-data-input" type="text" placeholder="{{ _('Which one?') }}" name="how_realm_creator_found_zulip_which_ai_chatbot" maxlength="100"/>
</div>
{% endif %}

View File

@@ -347,6 +347,7 @@ $(() => {
["ad", "how-realm-creator-found-zulip-where-ad"],
["existing_user", "how-realm-creator-found-zulip-which-organization"],
["review_site", "how-realm-creator-found-zulip-review-site"],
["ai_chatbot", "how-realm-creator-found-zulip-which-ai-chatbot"],
]);
const hideElement = (element: string): void => {

View File

@@ -203,6 +203,9 @@ class RegistrationForm(RealmDetailsForm):
self.fields["how_realm_creator_found_zulip_review_site"] = forms.CharField(
max_length=100, required=False
)
self.fields["how_realm_creator_found_zulip_which_ai_chatbot"] = forms.CharField(
max_length=100, required=False
)
def clean_full_name(self) -> str:
try:

View File

@@ -190,6 +190,7 @@ class AbstractRealmAuditLog(models.Model):
HOW_REALM_CREATOR_FOUND_ZULIP_OPTIONS = {
"existing_user": "At an organization that's using it",
"search_engine": "Search engine",
"ai_chatbot": "AI/LLM",
"review_site": "Review site",
"personal_recommendation": "Personal recommendation",
"hacker_news": "Hacker News",

View File

@@ -637,6 +637,7 @@ def registration_helper(
"ad": "how_realm_creator_found_zulip_where_ad",
"existing_user": "how_realm_creator_found_zulip_which_organization",
"review_site": "how_realm_creator_found_zulip_review_site",
"ai_chatbot": "how_realm_creator_found_zulip_which_ai_chatbot",
}
for option, field_name in extra_context_options.items():
if (