context_processors: use a common context for emails.

Fixes #1611.
This commit is contained in:
paxapy
2016-11-08 12:07:47 +03:00
committed by Tim Abbott
parent 8c7ed80281
commit ff1e97603d
5 changed files with 45 additions and 40 deletions

View File

@@ -4,12 +4,22 @@ from typing import Dict, Any
from django.http import HttpRequest
from django.conf import settings
from zerver.models import get_realm_by_string_id
from zerver.models import UserProfile, get_realm_by_string_id
from zproject.backends import (password_auth_enabled, dev_auth_enabled,
google_auth_enabled, github_auth_enabled)
from zerver.lib.utils import get_subdomain
def common_context(user):
# type: (UserProfile) -> Dict[str, Any]
return {
'realm_uri': user.realm.uri,
'server_uri': settings.SERVER_URI,
'external_uri_scheme': settings.EXTERNAL_URI_SCHEME,
'external_host': settings.EXTERNAL_HOST,
}
def add_settings(request):
# type: (HttpRequest) -> Dict[str, Any]
realm = None