Skip to content

Commit

Permalink
templates: Make zulip_default_context available in API endpoints.
Browse files Browse the repository at this point in the history
This is mostly useful for advertising support_email, but some other
fields may by helpful over time.
  • Loading branch information
timabbott committed Jun 1, 2018
1 parent 95f1f1d commit c37fe99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions zerver/templatetags/app_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
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()
Expand Down
3 changes: 3 additions & 0 deletions zerver/views/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
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):
Expand Down

0 comments on commit c37fe99

Please sign in to comment.