Commit 20b6dd51 by Troy Sankey

Move analytics initialization out of lms.startup.run

lms.startup is being removed, so initialize the analytics module in the
lms_initialization ready() method instead.
parent 1e599bed
...@@ -22,4 +22,11 @@ class LMSInitializationConfig(AppConfig): ...@@ -22,4 +22,11 @@ class LMSInitializationConfig(AppConfig):
Global LMS initialization methods are called here. This runs after Global LMS initialization methods are called here. This runs after
settings have loaded, but before most other djangoapp initializations. settings have loaded, but before most other djangoapp initializations.
""" """
pass self._initialize_analytics()
def _initialize_analytics(self):
"""
Initialize Segment analytics module by setting the write_key.
"""
if settings.LMS_SEGMENT_KEY:
analytics.write_key = settings.LMS_SEGMENT_KEY
...@@ -13,7 +13,6 @@ settings.INSTALLED_APPS # pylint: disable=pointless-statement ...@@ -13,7 +13,6 @@ settings.INSTALLED_APPS # pylint: disable=pointless-statement
from openedx.core.lib.django_startup import autostartup from openedx.core.lib.django_startup import autostartup
from openedx.core.release import doc_version from openedx.core.release import doc_version
import analytics
from openedx.core.djangoapps.monkey_patch import django_db_models_options from openedx.core.djangoapps.monkey_patch import django_db_models_options
...@@ -57,10 +56,6 @@ def run(): ...@@ -57,10 +56,6 @@ def run():
# Mako requires the directories to be added after the django setup. # Mako requires the directories to be added after the django setup.
microsite.enable_microsites(log) microsite.enable_microsites(log)
# Initialize Segment analytics module by setting the write_key.
if settings.LMS_SEGMENT_KEY:
analytics.write_key = settings.LMS_SEGMENT_KEY
# register any dependency injections that we need to support in edx_proctoring # register any dependency injections that we need to support in edx_proctoring
# right now edx_proctoring is dependent on the openedx.core.djangoapps.credit and # right now edx_proctoring is dependent on the openedx.core.djangoapps.credit and
# lms.djangoapps.grades # lms.djangoapps.grades
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment