web: Save a 301 redirect from /billing to /billing/.

This commit is contained in:
Alex Vandiver 2023-03-23 03:28:36 +00:00 committed by Tim Abbott
parent 8da1c51a06
commit ab7ff6b582
10 changed files with 15 additions and 15 deletions

View File

@ -848,7 +848,7 @@ class StripeTest(StripeTestCase):
self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
self.assertEqual("/billing/", response["Location"]) self.assertEqual("/billing/", response["Location"])
# Check /billing has the correct information # Check /billing/ has the correct information
with patch("corporate.views.billing_page.timezone_now", return_value=self.now): with patch("corporate.views.billing_page.timezone_now", return_value=self.now):
response = self.client_get("/billing/") response = self.client_get("/billing/")
self.assert_not_in_success_response(["Pay annually"], response) self.assert_not_in_success_response(["Pay annually"], response)
@ -989,7 +989,7 @@ class StripeTest(StripeTestCase):
self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
self.assertEqual("/billing/", response["Location"]) self.assertEqual("/billing/", response["Location"])
# Check /billing has the correct information # Check /billing/ has the correct information
with patch("corporate.views.billing_page.timezone_now", return_value=self.now): with patch("corporate.views.billing_page.timezone_now", return_value=self.now):
response = self.client_get("/billing/") response = self.client_get("/billing/")
self.assert_not_in_success_response(["Pay annually", "Update card"], response) self.assert_not_in_success_response(["Pay annually", "Update card"], response)

View File

@ -88,7 +88,7 @@
{% endif %} {% endif %}
</a> </a>
{% elif sponsorship_pending %} {% elif sponsorship_pending %}
<a href="/billing" class="button black-current-value" type="button"> <a href="/billing/" class="button black-current-value" type="button">
Sponsorship pending Sponsorship pending
</a> </a>
{% else %} {% else %}

View File

@ -8,7 +8,7 @@ export function create_update_license_request() {
"licensechange", "licensechange",
["licenses_at_next_renewal"], ["licenses_at_next_renewal"],
"PATCH", "PATCH",
() => window.location.replace("/billing"), () => window.location.replace("/billing/"),
); );
} }
@ -56,13 +56,13 @@ export function initialize() {
"licensechange", "licensechange",
["licenses"], ["licenses"],
"PATCH", "PATCH",
() => window.location.replace("/billing"), () => window.location.replace("/billing/"),
); );
}); });
$("#change-plan-status").on("click", (e) => { $("#change-plan-status").on("click", (e) => {
helpers.create_ajax_request("/json/billing/plan", "planchange", [], "PATCH", () => helpers.create_ajax_request("/json/billing/plan", "planchange", [], "PATCH", () =>
window.location.replace("/billing"), window.location.replace("/billing/"),
); );
e.preventDefault(); e.preventDefault();
}); });

View File

@ -37,7 +37,7 @@ function handle_session_complete_event(session) {
case "free_trial_upgrade_from_billing_page": case "free_trial_upgrade_from_billing_page":
message = message =
"Your free trial of Zulip Cloud Standard has been activated. You would be redirected to the billing page soon."; "Your free trial of Zulip Cloud Standard has been activated. You would be redirected to the billing page soon.";
redirect_to = "/billing"; redirect_to = "/billing/";
break; break;
case "free_trial_upgrade_from_onboarding_page": case "free_trial_upgrade_from_onboarding_page":
message = message =

View File

@ -32,7 +32,7 @@ export const initialize = () => {
} }
e.preventDefault(); e.preventDefault();
helpers.create_ajax_request("/json/billing/upgrade", "invoice", [], "POST", () => helpers.create_ajax_request("/json/billing/upgrade", "invoice", [], "POST", () =>
window.location.replace("/billing"), window.location.replace("/billing/"),
); );
}); });

View File

@ -135,7 +135,7 @@
</li> </li>
{{#if show_billing}} {{#if show_billing}}
<li role="presentation" class="hidden-for-spectators"> <li role="presentation" class="hidden-for-spectators">
<a href="/billing" target="_blank" rel="noopener noreferrer" role="menuitem"> <a href="/billing/" target="_blank" rel="noopener noreferrer" role="menuitem">
<i class="fa fa-credit-card" aria-hidden="true"></i> {{t 'Billing' }} <i class="fa fa-credit-card" aria-hidden="true"></i> {{t 'Billing' }}
</a> </a>
</li> </li>

View File

@ -66,7 +66,7 @@ run_test("planchange", ({override}) => {
assert.deepEqual(ignored_inputs, []); assert.deepEqual(ignored_inputs, []);
assert.equal(method, "PATCH"); assert.equal(method, "PATCH");
location.replace = (new_location) => { location.replace = (new_location) => {
assert.equal(new_location, "/billing"); assert.equal(new_location, "/billing/");
}; };
success_callback(); success_callback();
create_ajax_request_called = true; create_ajax_request_called = true;
@ -89,7 +89,7 @@ run_test("licensechange", ({override}) => {
assert.deepEqual(ignored_inputs, ["licenses_at_next_renewal"]); assert.deepEqual(ignored_inputs, ["licenses_at_next_renewal"]);
assert.equal(method, "PATCH"); assert.equal(method, "PATCH");
location.replace = (new_location) => { location.replace = (new_location) => {
assert.equal(new_location, "/billing"); assert.equal(new_location, "/billing/");
}; };
success_callback(); success_callback();
create_ajax_request_called = true; create_ajax_request_called = true;
@ -153,7 +153,7 @@ run_test("licensechange", ({override}) => {
assert.deepEqual(ignored_inputs, ["licenses"]); assert.deepEqual(ignored_inputs, ["licenses"]);
assert.equal(method, "PATCH"); assert.equal(method, "PATCH");
location.replace = (new_location) => { location.replace = (new_location) => {
assert.equal(new_location, "/billing"); assert.equal(new_location, "/billing/");
}; };
success_callback(); success_callback();
create_ajax_request_called = true; create_ajax_request_called = true;

View File

@ -139,7 +139,7 @@ run_test("check_status", async ({override}) => {
set_global("window", { set_global("window", {
location: { location: {
replace(new_location) { replace(new_location) {
assert.equal(new_location, "/billing"); assert.equal(new_location, "/billing/");
}, },
}, },
}); });

View File

@ -54,7 +54,7 @@ run_test("initialize", ({override_rewire}) => {
assert.deepEqual(ignored_inputs, []); assert.deepEqual(ignored_inputs, []);
assert.equal(type, "POST"); assert.equal(type, "POST");
location.replace = (new_location) => { location.replace = (new_location) => {
assert.equal(new_location, "/billing"); assert.equal(new_location, "/billing/");
}; };
success_callback(); success_callback();
break; break;

View File

@ -24,7 +24,7 @@ gear_info = {
"integrations": ["Integrations", "/integrations/"], "integrations": ["Integrations", "/integrations/"],
"stats": ["Usage statistics", "/stats"], "stats": ["Usage statistics", "/stats"],
"plans": ["Plans and pricing", "/plans/"], "plans": ["Plans and pricing", "/plans/"],
"billing": ["Billing", "/billing"], "billing": ["Billing", "/billing/"],
"invite": ["Invite users", "/#invite"], "invite": ["Invite users", "/#invite"],
"about-zulip": ["About Zulip", "/#about-zulip"], "about-zulip": ["About Zulip", "/#about-zulip"],
} }