Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

plans_page: Fix broken redirection to /accounts/login/.

Eeshan Garg512229cf7dff
diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.py
index c281c898514..03ecc65a46e 100644
--- a/zerver/tests/test_docs.py
+++ b/zerver/tests/test_docs.py
@@ -399,7 +399,7 @@ class PlansPageTest(ZulipTestCase):
realm.save(update_fields=["plan_type"])
result = self.client_get("/plans/", subdomain="zulip")
self.assertEqual(result.status_code, 302)
- self.assertEqual(result["Location"], "/accounts/login/?next=plans")
+ self.assertEqual(result["Location"], "/accounts/login/?next=/plans")
guest_user = "polonius"
self.login(guest_user)
diff --git a/zerver/views/portico.py b/zerver/views/portico.py
index 8302e11960a..6836809963e 100644
--- a/zerver/views/portico.py
+++ b/zerver/views/portico.py
@@ -47,7 +47,7 @@ def plans_view(request: HttpRequest) -> HttpResponse:
if realm.plan_type == Realm.SELF_HOSTED and settings.PRODUCTION:
return HttpResponseRedirect("https://zulip.com/plans")
if not request.user.is_authenticated:
- return redirect_to_login(next="plans")
+ return redirect_to_login(next="/plans")
if request.user.is_guest:
return TemplateResponse(request, "404.html", status=404)
if settings.CORPORATE_ENABLED: