* For all files, from __future__ import unicode_literals. * Add @python_2_unicode_compatible to both models. * Test six.string_type(obj) for both models. Also, fix some new pylint warnings and improve model repr methods. MST-24
20 lines
467 B
Python
20 lines
467 B
Python
"""
|
|
Utility methods related to teams.
|
|
"""
|
|
|
|
from __future__ import absolute_import, unicode_literals
|
|
|
|
from eventtracking import tracker
|
|
|
|
from track import contexts
|
|
|
|
|
|
def emit_team_event(event_name, course_key, event_data):
|
|
"""
|
|
Emit team events with the correct course id context.
|
|
"""
|
|
context = contexts.course_context_from_course_id(course_key)
|
|
|
|
with tracker.get_tracker().context(event_name, context):
|
|
tracker.emit(event_name, event_data)
|