mirror of https://github.com/zulip/zulip.git
remote_billing_page: Redirect servers to correct URL after login.
This commit is contained in:
parent
ff368e3240
commit
8a1630ee42
|
@ -328,7 +328,7 @@ class LegacyServerLoginTest(BouncerTestCase):
|
|||
)
|
||||
|
||||
self.assertEqual(result.status_code, 302)
|
||||
self.assertEqual(result["Location"], f"/server/{self.uuid}/billing/")
|
||||
self.assertEqual(result["Location"], f"/server/{self.uuid}/upgrade")
|
||||
|
||||
# Verify the authed data that should have been stored in the session.
|
||||
identity_dict = LegacyServerIdentityDict(
|
||||
|
@ -340,7 +340,7 @@ class LegacyServerLoginTest(BouncerTestCase):
|
|||
identity_dict,
|
||||
)
|
||||
|
||||
result = self.client_get(result["Location"], subdomain="selfhosting")
|
||||
result = self.client_get(f"/server/{self.uuid}/billing/", subdomain="selfhosting")
|
||||
# The server has no plan, so the /billing page redirects to /upgrade
|
||||
self.assertEqual(result.status_code, 302)
|
||||
self.assertEqual(result["Location"], f"/server/{self.uuid}/upgrade")
|
||||
|
|
|
@ -272,11 +272,20 @@ def remote_billing_legacy_server_login(
|
|||
)
|
||||
|
||||
assert next_page in VALID_NEXT_PAGES
|
||||
if next_page is None:
|
||||
return HttpResponseRedirect(
|
||||
reverse("remote_server_billing_page", args=(remote_server_uuid,))
|
||||
)
|
||||
else:
|
||||
if next_page is not None:
|
||||
return HttpResponseRedirect(
|
||||
reverse(f"remote_server_{next_page}_page", args=(remote_server_uuid,))
|
||||
)
|
||||
elif remote_server.plan_type == RemoteZulipServer.PLAN_TYPE_SELF_HOSTED:
|
||||
# TODO: Take user to plans page once that is available.
|
||||
return HttpResponseRedirect(
|
||||
reverse("remote_server_upgrade_page", args=(remote_server_uuid,))
|
||||
)
|
||||
elif remote_server.plan_type == RemoteZulipServer.PLAN_TYPE_COMMUNITY:
|
||||
return HttpResponseRedirect(
|
||||
reverse("remote_server_sponsorship_page", args=(remote_server_uuid,))
|
||||
)
|
||||
else:
|
||||
return HttpResponseRedirect(
|
||||
reverse("remote_server_billing_page", args=(remote_server_uuid,))
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue