From 3cf0156997f013241f5811e173d69ac4687847db Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 29 Apr 2021 17:10:10 -0700 Subject: [PATCH] context_processors: Remove unnecessary get_client_name call. This detail is now being managed by our middleware. --- zerver/context_processors.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/zerver/context_processors.py b/zerver/context_processors.py index 3229f63d23..024240d6fd 100644 --- a/zerver/context_processors.py +++ b/zerver/context_processors.py @@ -14,7 +14,6 @@ from version import ( LATEST_RELEASE_VERSION, ZULIP_VERSION, ) -from zerver.decorator import get_client_name from zerver.lib.exceptions import InvalidSubdomainError from zerver.lib.realm_description import get_realm_rendered_description, get_realm_text_description from zerver.lib.realm_icon import get_realm_icon_url @@ -131,11 +130,6 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]: f'{escape(support_email)}' ) - # We can't use request.client here because we might not be using - # an auth decorator that sets it, but we can call its helper to - # get the same result. - platform = get_client_name(request) - default_page_params = { **DEFAULT_PAGE_PARAMS, "request_language": get_language(), @@ -170,7 +164,7 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]: "settings_path": settings_path, "secrets_path": secrets_path, "settings_comments_path": settings_comments_path, - "platform": platform, + "platform": request.client_name, "allow_search_engine_indexing": allow_search_engine_indexing, "landing_page_navbar_message": settings.LANDING_PAGE_NAVBAR_MESSAGE, "default_page_params": default_page_params,