signals: Avoid importing bugdown from early initialization.

This fixes `tools/build-release-tarballs` failing.
This commit is contained in:
Tim Abbott 2017-03-25 17:27:45 -07:00
parent 004133561b
commit 6a884acff5
1 changed files with 5 additions and 4 deletions

View File

@ -8,10 +8,6 @@ from django.template import loader
from django.utils import timezone from django.utils import timezone
from typing import Any, Dict, Optional from typing import Any, Dict, Optional
from zerver.context_processors import common_context
from zerver.models import UserProfile
def get_device_browser(user_agent): def get_device_browser(user_agent):
# type: (str) -> Optional[str] # type: (str) -> Optional[str]
user_agent = user_agent.lower() user_agent = user_agent.lower()
@ -54,6 +50,11 @@ def get_device_os(user_agent):
def email_on_new_login(sender, user, request, **kwargs): def email_on_new_login(sender, user, request, **kwargs):
# type: (Any, UserProfile, Any, Any) -> None # type: (Any, UserProfile, Any, Any) -> None
# We import here to minimize the dependencies of this module,
# since it runs as part of `manage.py` initialization
from zerver.context_processors import common_context
from zerver.models import UserProfile
if not settings.SEND_LOGIN_EMAILS: if not settings.SEND_LOGIN_EMAILS:
return return