create_realm: Show import text only if automated import is disabled.

This helps preserve the original form in production.

The new "Import from" option button allows user to automate the
process, so this is not required in that case.
This commit is contained in:
Aman Agrawal
2025-04-29 11:35:02 +05:30
committed by Tim Abbott
parent b68479f623
commit 80e76d24e9
2 changed files with 7 additions and 0 deletions

View File

@@ -47,6 +47,7 @@
</div>
</form>
</div>
{% if not is_realm_import_enabled %}
<div class="bottom-text">
{% trans %}
Or import
@@ -54,6 +55,7 @@
or <a href="/help/import-from-rocketchat">Rocket.Chat</a>.
{% endtrans %}
</div>
{% endif %}
</div>
</div>
</div>

View File

@@ -283,6 +283,10 @@ def latest_info_context() -> dict[str, str]:
return context
def is_realm_import_enabled() -> bool:
return settings.MAX_WEB_DATA_IMPORT_SIZE_MB != 0
def get_realm_create_form_context() -> dict[str, Any]:
context = {
"language_list": get_language_list(),
@@ -290,5 +294,6 @@ def get_realm_create_form_context() -> dict[str, Any]:
"MAX_REALM_SUBDOMAIN_LENGTH": str(Realm.MAX_REALM_SUBDOMAIN_LENGTH),
"root_domain_available": is_root_domain_available(),
"sorted_realm_types": sorted(Realm.ORG_TYPES.values(), key=lambda d: d["display_order"]),
"is_realm_import_enabled": is_realm_import_enabled(),
}
return context