Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
web: Save a needless 301 redirect from /upgrade to /upgrade/.
Alex Vandiver5967dda35d2b
diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.pyindex 8ced58c60df..fa961ef3e81 100644--- a/corporate/tests/test_stripe.py+++ b/corporate/tests/test_stripe.py@@ -4162,12 +4162,12 @@ class RequiresBillingAccessTest(StripeTestCase):@mock_stripe()def test_billing_page_permissions(self, *mocks: Mock) -> None:- # Guest users can't access /upgrade page+ # Guest users can't access /upgrade/ pageself.login_user(self.example_user("polonius"))response = self.client_get("/upgrade/", follow=True)self.assertEqual(response.status_code, 404)- # Check that non-admins can access /upgrade via /billing, when there is no Customer object+ # Check that non-admins can access /upgrade/ via /billing, when there is no Customer objectself.login_user(self.example_user("hamlet"))response = self.client_get("/billing/")self.assertEqual(response.status_code, 302)diff --git a/corporate/views/portico.py b/corporate/views/portico.pyindex cca62bf4b6b..b7873864484 100644--- a/corporate/views/portico.py+++ b/corporate/views/portico.py@@ -52,7 +52,7 @@ def plans_view(request: HttpRequest) -> HttpResponse:realm = get_realm_from_request(request)free_trial_days = settings.FREE_TRIAL_DAYSsponsorship_pending = False- sponsorship_url = "/upgrade#sponsorship"+ sponsorship_url = "/upgrade/#sponsorship"if is_subdomain_root_or_alias(request):# If we're on the root domain, we make this link first ask you which organization.sponsorship_url = f"/accounts/go/?{urlencode({'next': sponsorship_url})}"diff --git a/templates/corporate/billing.html b/templates/corporate/billing.htmlindex 6ef160507ce..f268ba91253 100644--- a/templates/corporate/billing.html+++ b/templates/corporate/billing.html@@ -201,7 +201,7 @@<center><p><h2>Your organization is on the <b>Zulip Free</b> plan.</h2>- <a href="/upgrade">+ <a href="/upgrade/"><button type="submit" class="button green">Upgrade to Standard</button></a><a href="/plans">diff --git a/templates/corporate/for/communities.html b/templates/corporate/for/communities.htmlindex 96b41c37625..1e897705f58 100644--- a/templates/corporate/for/communities.html+++ b/templates/corporate/for/communities.html@@ -33,7 +33,7 @@<a href="/new/" class="button">{{ _('Create organization') }}</a>- <a href="/accounts/go/?next=/upgrade%23sponsorship" class="button">+ <a href="/accounts/go/?next=/upgrade/%23sponsorship" class="button">{{ _('Request sponsorship') }}</a><a href="/self-hosting/" class="button">@@ -55,7 +55,7 @@<div class="bottom-text-large"><p> Join the hundreds of communities we sponsor. Contact <a href="mailto:[email protected]">[email protected]</a> to check whether your organization- qualifies, or <a href="/accounts/go/?next=/upgrade%23sponsorship">request+ qualifies, or <a href="/accounts/go/?next=/upgrade/%23sponsorship">requestsponsorship</a> today.</p></div>@@ -63,7 +63,7 @@<a href="/new/" class="button">{{ _('Create organization') }}</a>- <a href="/accounts/go/?next=/upgrade%23sponsorship" class="button">+ <a href="/accounts/go/?next=/upgrade/%23sponsorship" class="button">{{ _('Request sponsorship') }}</a><a href="/self-hosting/" class="button">diff --git a/templates/corporate/for/education.html b/templates/corporate/for/education.htmlindex 1e89cfef95e..14d33044ec0 100644--- a/templates/corporate/for/education.html+++ b/templates/corporate/for/education.html@@ -316,7 +316,7 @@$0.80/month billed monthly</div></div>- <a href="/accounts/go/?next=/upgrade%23sponsorship" class="button green standard-register-button">+ <a href="/accounts/go/?next=/upgrade/%23sponsorship" class="button green standard-register-button">Request education pricing</a></div>diff --git a/templates/corporate/for/events.html b/templates/corporate/for/events.htmlindex 7b864871855..683361734b0 100644--- a/templates/corporate/for/events.html+++ b/templates/corporate/for/events.html@@ -33,7 +33,7 @@<a href="/new/" class="button">{{ _('Create organization') }}</a>- <a href="/accounts/go/?next=/upgrade%23sponsorship" class="button">+ <a href="/accounts/go/?next=/upgrade/%23sponsorship" class="button">{{ _('Request sponsorship') }}</a><a href="/self-hosting/" class="button">@@ -287,7 +287,7 @@<a href="/new/" class="button">{{ _('Create organization') }}</a>- <a href="/accounts/go/?next=/upgrade%23sponsorship" class="button">+ <a href="/accounts/go/?next=/upgrade/%23sponsorship" class="button">{{ _('Request sponsorship') }}</a><a href="/self-hosting/" class="button">diff --git a/templates/corporate/for/open-source.html b/templates/corporate/for/open-source.htmlindex 8f0c32ad45b..de743a1a06f 100644--- a/templates/corporate/for/open-source.html+++ b/templates/corporate/for/open-source.html@@ -35,7 +35,7 @@<a href="/new/" class="button">{{ _('Create organization') }}</a>- <a href="/accounts/go/?next=/upgrade%23sponsorship" class="button">+ <a href="/accounts/go/?next=/upgrade/%23sponsorship" class="button">{{ _('Request sponsorship') }}</a><a href="/self-hosting/" class="button">@@ -719,7 +719,7 @@<a href="/new/" class="button">{{ _('Create organization') }}</a>- <a href="/accounts/go/?next=/upgrade%23sponsorship" class="button">+ <a href="/accounts/go/?next=/upgrade/%23sponsorship" class="button">{{ _('Request sponsorship') }}</a><a href="/self-hosting/" class="button">diff --git a/templates/corporate/for/research.html b/templates/corporate/for/research.htmlindex 6445147867f..fbe90238b94 100644--- a/templates/corporate/for/research.html+++ b/templates/corporate/for/research.html@@ -35,7 +35,7 @@<a href="/new/" class="button">{{ _('Create organization') }}</a>- <a href="/accounts/go/?next=/upgrade%23sponsorship" class="button">+ <a href="/accounts/go/?next=/upgrade/%23sponsorship" class="button">{{ _('Request sponsorship') }}</a><a href="/self-hosting/" class="button">@@ -401,7 +401,7 @@<a href="/new/" class="button">{{ _('Create organization') }}</a>- <a href="/accounts/go/?next=/upgrade%23sponsorship" class="button">+ <a href="/accounts/go/?next=/upgrade/%23sponsorship" class="button">{{ _('Request sponsorship') }}</a><a href="/self-hosting/" class="button">diff --git a/templates/corporate/pricing_model.html b/templates/corporate/pricing_model.htmlindex d93a9516588..619bbe2b844 100644--- a/templates/corporate/pricing_model.html+++ b/templates/corporate/pricing_model.html@@ -35,7 +35,7 @@</a>{% elif realm.plan_type == realm.PLAN_TYPE_LIMITED or sponsorship_pending %}<div class="pricing-details"></div>- <a href='/upgrade' class="button black-current-value" type="button">+ <a href='/upgrade/' class="button black-current-value" type="button">Current plan</a>{% endif %}@@ -72,7 +72,7 @@</div></div>{% if not realm %}- <a href="/upgrade" class="button green">+ <a href="/upgrade/" class="button green">{% if free_trial_days %}Start {{ free_trial_days }} day free trial{% else %}@@ -92,7 +92,7 @@Sponsorship pending</a>{% else %}- <a href="/upgrade" class="button green">+ <a href="/upgrade/" class="button green">{% if free_trial_days %}Start {{ free_trial_days }} day free trial{% else %}diff --git a/web/templates/gear_menu.hbs b/web/templates/gear_menu.hbsindex de98ad88308..824257b2891 100644--- a/web/templates/gear_menu.hbs+++ b/web/templates/gear_menu.hbs@@ -28,17 +28,17 @@{{/if}}{{#if (and is_plan_limited is_owner) }}<li class="org-info org-upgrade small-font-size">- <a href="/upgrade" target="_blank" rel="noopener noreferrer" role="menuitem">{{t "Upgrade to {standard_plan_name}" }}</a>+ <a href="/upgrade/" target="_blank" rel="noopener noreferrer" role="menuitem">{{t "Upgrade to {standard_plan_name}" }}</a></li>{{/if}}{{#if is_plan_limited }}{{#if is_education_org }}<li class="org-info org-upgrade small-font-size">- <a href="/upgrade" target="_blank" rel="noopener noreferrer" role="menuitem">{{t 'Request education pricing' }}</a>+ <a href="/upgrade/" target="_blank" rel="noopener noreferrer" role="menuitem">{{t 'Request education pricing' }}</a></li>{{else if (not is_business_org) }}<li class="org-info org-upgrade small-font-size">- <a href="/upgrade" target="_blank" rel="noopener noreferrer" role="menuitem">{{t 'Request sponsorship' }}</a>+ <a href="/upgrade/" target="_blank" rel="noopener noreferrer" role="menuitem">{{t 'Request sponsorship' }}</a></li>{{/if}}{{/if}}diff --git a/web/templates/settings/upgrade_tip_widget.hbs b/web/templates/settings/upgrade_tip_widget.hbsindex 055afc89591..1b3cb656662 100644--- a/web/templates/settings/upgrade_tip_widget.hbs+++ b/web/templates/settings/upgrade_tip_widget.hbs@@ -1,14 +1,14 @@<div>{{#unless zulip_plan_is_not_limited}}{{#if is_business_type_org}}- <a href="/upgrade" class="upgrade-tip" target="_blank" rel="noopener noreferrer">+ <a href="/upgrade/" class="upgrade-tip" target="_blank" rel="noopener noreferrer">{{upgrade_text_for_wide_organization_logo}}</a>{{else}}<div class="upgrade-or-sponsorship-tip">{{#tr}}Available on Zulip Cloud Standard. <z-link-upgrade>Upgrade</z-link-upgrade> or <z-link-sponsorship>request sponsorship</z-link-sponsorship> to access.- {{#*inline "z-link-upgrade"}}<a href="/upgrade" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}+ {{#*inline "z-link-upgrade"}}<a href="/upgrade/" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}{{#*inline "z-link-sponsorship"}}<a href="/upgrade/#sponsorship" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}{{/tr}}</div>diff --git a/web/templates/settings/upload_space_stats.hbs b/web/templates/settings/upload_space_stats.hbsindex c3e1ac0a233..d0aba8bf002 100644--- a/web/templates/settings/upload_space_stats.hbs+++ b/web/templates/settings/upload_space_stats.hbs@@ -3,7 +3,7 @@{{#if show_upgrade_message}}{{#tr}}<z-link>Upgrade</z-link> for more space.- {{#*inline "z-link"}}<a href="/upgrade" target="_blank" rel="noopener noreferrer">{{> @partial-block }}</a>{{/inline}}+ {{#*inline "z-link"}}<a href="/upgrade/" target="_blank" rel="noopener noreferrer">{{> @partial-block }}</a>{{/inline}}{{/tr}}{{/if}}</span>diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.pyindex 7f54f0bef58..8e0d2963036 100644--- a/zerver/tests/test_docs.py+++ b/zerver/tests/test_docs.py@@ -410,8 +410,8 @@ class PlansPageTest(ZulipTestCase):root_domain = ""result = self.client_get("/plans/", subdomain=root_domain)self.assert_in_success_response(["Self-host Zulip"], result)- self.assert_not_in_success_response(["/upgrade#sponsorship"], result)- self.assert_in_success_response(["/accounts/go/?next=%2Fupgrade%23sponsorship"], result)+ self.assert_not_in_success_response(["/upgrade/#sponsorship"], result)+ self.assert_in_success_response(["/accounts/go/?next=%2Fupgrade%2F%23sponsorship"], result)non_existent_domain = "moo"result = self.client_get("/plans/", subdomain=non_existent_domain)@@ -434,8 +434,10 @@ class PlansPageTest(ZulipTestCase):self.login(organization_member)result = self.client_get("/plans/", subdomain="zulip")self.assert_in_success_response(["Current plan"], result)- self.assert_in_success_response(["/upgrade#sponsorship"], result)- self.assert_not_in_success_response(["/accounts/go/?next=%2Fupgrade%23sponsorship"], result)+ self.assert_in_success_response(["/upgrade/#sponsorship"], result)+ self.assert_not_in_success_response(+ ["/accounts/go/?next=%2Fupgrade%2F%23sponsorship"], result+ )# Test root domain, with login on different domainresult = self.client_get("/plans/", subdomain="")