Commit 14e1ef13 by Bill DeRusha

Merge pull request #9865 from edx/bderusha/segment-version-bump

Bump version of segemnt's analytics-python package to 1.1.0
parents a4c99964 4f14d4f7
......@@ -64,6 +64,7 @@ import urllib
import analytics
from eventtracking import tracker
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.http import HttpResponseBadRequest
......@@ -592,7 +593,7 @@ def login_analytics(strategy, auth_entry, *args, **kwargs):
elif auth_entry in [AUTH_ENTRY_ACCOUNT_SETTINGS]:
event_name = 'edx.bi.user.account.linked'
if event_name is not None:
if event_name is not None and hasattr(settings, 'SEGMENT_IO_LMS_KEY') and settings.SEGMENT_IO_LMS_KEY:
tracking_context = tracker.get_tracker().resolve_context()
analytics.track(
kwargs['user'].id,
......
......@@ -40,8 +40,8 @@ def run():
# Initialize Segment.io analytics module. Flushes first time a message is received and
# every 50 messages thereafter, or if 10 seconds have passed since last flush
if settings.FEATURES.get('SEGMENT_IO_LMS') and hasattr(settings, 'SEGMENT_IO_LMS_KEY'):
analytics.init(settings.SEGMENT_IO_LMS_KEY, flush_at=50)
if settings.FEATURES.get('SEGMENT_IO_LMS') and hasattr(settings, 'SEGMENT_IO_LMS_KEY') and settings.SEGMENT_IO_LMS_KEY: # pylint: disable=line-too-long
analytics.write_key = settings.SEGMENT_IO_LMS_KEY
# register any dependency injections that we need to support in edx_proctoring
# right now edx_proctoring is dependent on the openedx.core.djangoapps.credit
......
......@@ -147,7 +147,7 @@ splinter==0.5.4
testtools==0.9.34
# Used for Segment.io analytics
analytics-python==0.4.4
analytics-python==1.1.0
# Needed for mailchimp(mailing djangoapp)
mailsnake==1.6.2
......
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