mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 01:47:41 +00:00
portico: Move portico view code to its own file.
This improves the readability of the codebase.
This commit is contained in:
@@ -7,9 +7,8 @@ from django.shortcuts import redirect, render
|
||||
from django.utils import translation
|
||||
from django.utils.cache import patch_cache_control
|
||||
|
||||
from zerver.context_processors import get_realm_from_request, latest_info_context
|
||||
from zerver.decorator import zulip_login_required, \
|
||||
redirect_to_login
|
||||
from zerver.context_processors import latest_info_context
|
||||
from zerver.decorator import zulip_login_required
|
||||
from zerver.forms import ToSForm
|
||||
from zerver.models import Message, UserProfile, \
|
||||
Realm, UserMessage, \
|
||||
@@ -298,19 +297,3 @@ def home_real(request: HttpRequest) -> HttpResponse:
|
||||
@zulip_login_required
|
||||
def desktop_home(request: HttpRequest) -> HttpResponse:
|
||||
return HttpResponseRedirect(reverse('zerver.views.home.home'))
|
||||
|
||||
def apps_view(request: HttpRequest, _: str) -> HttpResponse:
|
||||
if settings.ZILENCER_ENABLED:
|
||||
return render(request, 'zerver/apps.html')
|
||||
return HttpResponseRedirect('https://zulipchat.com/apps/', status=301)
|
||||
|
||||
def plans_view(request: HttpRequest) -> HttpResponse:
|
||||
realm = get_realm_from_request(request)
|
||||
realm_plan_type = 0
|
||||
if realm is not None:
|
||||
realm_plan_type = realm.plan_type
|
||||
if realm.plan_type == Realm.SELF_HOSTED and settings.PRODUCTION:
|
||||
return HttpResponseRedirect('https://zulipchat.com/plans')
|
||||
if not request.user.is_authenticated:
|
||||
return redirect_to_login(next="plans")
|
||||
return render(request, "zerver/plans.html", context={"realm_plan_type": realm_plan_type})
|
||||
|
||||
Reference in New Issue
Block a user