mirror of https://github.com/zulip/zulip.git
sentry: Initialize sentry in AppConfig ready hook.
This breaks an import cycle that prevented django-stubs from inferring types for django.conf.settings. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
a5cf3b3975
commit
676d40d66b
|
@ -16,6 +16,12 @@ class ZerverConfig(AppConfig):
|
||||||
name: str = "zerver"
|
name: str = "zerver"
|
||||||
|
|
||||||
def ready(self) -> None:
|
def ready(self) -> None:
|
||||||
|
if settings.SENTRY_DSN: # nocoverage
|
||||||
|
from zproject.config import get_config
|
||||||
|
from zproject.sentry import setup_sentry
|
||||||
|
|
||||||
|
setup_sentry(settings.SENTRY_DSN, get_config("machine", "deploy_type", "development"))
|
||||||
|
|
||||||
# We import zerver.signals here for the side effect of
|
# We import zerver.signals here for the side effect of
|
||||||
# registering the user_logged_in signal receiver. This import
|
# registering the user_logged_in signal receiver. This import
|
||||||
# needs to be here (rather than e.g. at top-of-file) to avoid
|
# needs to be here (rather than e.g. at top-of-file) to avoid
|
||||||
|
|
|
@ -1224,10 +1224,6 @@ TWO_FACTOR_PATCH_ADMIN = False
|
||||||
|
|
||||||
# Allow the environment to override the default DSN
|
# Allow the environment to override the default DSN
|
||||||
SENTRY_DSN = os.environ.get("SENTRY_DSN", SENTRY_DSN)
|
SENTRY_DSN = os.environ.get("SENTRY_DSN", SENTRY_DSN)
|
||||||
if SENTRY_DSN:
|
|
||||||
from .sentry import setup_sentry
|
|
||||||
|
|
||||||
setup_sentry(SENTRY_DSN, get_config("machine", "deploy_type", "development"))
|
|
||||||
|
|
||||||
SCIM_SERVICE_PROVIDER = {
|
SCIM_SERVICE_PROVIDER = {
|
||||||
"USER_ADAPTER": "zerver.lib.scim.ZulipSCIMUser",
|
"USER_ADAPTER": "zerver.lib.scim.ZulipSCIMUser",
|
||||||
|
|
Loading…
Reference in New Issue