From c37fe998d232d39b4e3f435598e9f129caf659dc Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 1 Jun 2018 11:31:16 -0700 Subject: [PATCH] templates: Make zulip_default_context available in API endpoints. This is mostly useful for advertising support_email, but some other fields may by helpful over time. --- zerver/templatetags/app_filters.py | 1 + zerver/views/integrations.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/zerver/templatetags/app_filters.py b/zerver/templatetags/app_filters.py index f386043ffb..fd37b89c4d 100644 --- a/zerver/templatetags/app_filters.py +++ b/zerver/templatetags/app_filters.py @@ -15,6 +15,7 @@ import zerver.lib.bugdown.fenced_code import zerver.lib.bugdown.api_arguments_table_generator import zerver.lib.bugdown.api_code_examples import zerver.lib.bugdown.help_settings_links +from zerver.context_processors import zulip_default_context from zerver.lib.cache import ignore_unhashable_lru_cache register = Library() diff --git a/zerver/views/integrations.py b/zerver/views/integrations.py index d855d7b02e..e614bc4aa6 100644 --- a/zerver/views/integrations.py +++ b/zerver/views/integrations.py @@ -16,8 +16,11 @@ from zerver.lib.request import has_request_variables, REQ from zerver.lib.subdomains import get_subdomain from zerver.models import Realm from zerver.templatetags.app_filters import render_markdown_path +from zerver.context_processors import zulip_default_context def add_api_uri_context(context: Dict[str, Any], request: HttpRequest) -> None: + context.update(zulip_default_context(request)) + subdomain = get_subdomain(request) if (subdomain != Realm.SUBDOMAIN_FOR_ROOT_DOMAIN or not settings.ROOT_DOMAIN_LANDING_PAGE):