diff --git a/corporate/urls.py b/corporate/urls.py index ac31d89005..d6fefbde2e 100644 --- a/corporate/urls.py +++ b/corporate/urls.py @@ -6,6 +6,14 @@ from django.views.generic import RedirectView, TemplateView from corporate.views.billing_page import billing_home, update_plan from corporate.views.event_status import event_status, event_status_page +from corporate.views.portico import ( + app_download_link_redirect, + apps_view, + hello_view, + landing_view, + plans_view, + team_view, +) from corporate.views.session import ( start_card_update_stripe_session, start_retry_payment_intent_session, @@ -14,14 +22,6 @@ from corporate.views.support import support_request from corporate.views.upgrade import initial_upgrade, sponsorship, upgrade from corporate.views.webhook import stripe_webhook from zerver.lib.rest import rest_path -from zerver.views.portico import ( - app_download_link_redirect, - apps_view, - hello_view, - landing_view, - plans_view, - team_view, -) i18n_urlpatterns: Any = [ # Zephyr/MIT diff --git a/zerver/views/portico.py b/corporate/views/portico.py similarity index 100% rename from zerver/views/portico.py rename to corporate/views/portico.py diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.py index 21a3b5fa62..f095544d9e 100644 --- a/zerver/tests/test_docs.py +++ b/zerver/tests/test_docs.py @@ -379,7 +379,7 @@ class AboutPageTest(ZulipTestCase): self.assert_in_success_response(["2017-11-20"], result) self.assert_in_success_response(["timabbott", "showell", "gnprice", "rishig"], result) - with mock.patch("zerver.views.portico.open", side_effect=FileNotFoundError) as m: + with mock.patch("corporate.views.portico.open", side_effect=FileNotFoundError) as m: result = self.client_get("/team/") self.assertEqual(result.status_code, 200) self.assert_in_success_response(["Never ran"], result) @@ -556,7 +556,7 @@ class AppsPageTest(ZulipTestCase): def test_app_download_link_view(self) -> None: return_value = "https://desktop-download.zulip.com/v5.4.3/Zulip-Web-Setup-5.4.3.exe" with mock.patch( - "zerver.views.portico.get_latest_github_release_download_link_for_platform", + "corporate.views.portico.get_latest_github_release_download_link_for_platform", return_value=return_value, ) as m: result = self.client_get("/apps/download/windows") diff --git a/zerver/views/home.py b/zerver/views/home.py index bc13b5e679..c3bf729223 100644 --- a/zerver/views/home.py +++ b/zerver/views/home.py @@ -19,7 +19,6 @@ from zerver.lib.subdomains import get_subdomain from zerver.lib.user_counts import realm_user_count from zerver.lib.utils import statsd from zerver.models import PreregistrationUser, Realm, Stream, UserProfile -from zerver.views.portico import hello_view def need_accept_tos(user_profile: Optional[UserProfile]) -> bool: @@ -120,6 +119,9 @@ def home(request: HttpRequest) -> HttpResponse: and subdomain == Realm.SUBDOMAIN_FOR_ROOT_DOMAIN and settings.CORPORATE_ENABLED ): + + from corporate.views.portico import hello_view + return hello_view(request) realm = get_realm_from_request(request)