Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions openedx/core/djangoapps/notifications/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from common.djangoapps.track import contexts, segment

NOTIFICATION_PREFERENCES_VIEWED = 'edx.notifications.preferences.viewed'
NOTIFICATION_GENERATED = 'edx.notifications.generated'
NOTIFICATION_READ = 'edx.notifications.read'
NOTIFICATION_APP_ALL_READ = 'edx.notifications.app_all_read'
Expand Down Expand Up @@ -46,35 +45,6 @@ def notification_event_context(user, course_id, notification):
}


def notification_preferences_viewed_event(request, course_id=None):
"""
Emit an event when a user views their notification preferences.
"""
event_data = {
'user_id': str(request.user.id),
'course_id': None,
'user_forum_roles': [],
'user_course_roles': [],
'type': 'account'
}
if not course_id:
tracker.emit(
NOTIFICATION_PREFERENCES_VIEWED,
event_data
)
return
context = contexts.course_context_from_course_id(course_id)
with tracker.get_tracker().context(NOTIFICATION_PREFERENCES_VIEWED, context):
event_data['course_id']: str(course_id)
event_data['user_forum_roles'] = get_user_forums_roles(request.user, course_id)
event_data['user_course_roles'] = get_user_course_roles(request.user, course_id)
event_data['type'] = 'course'
tracker.emit(
NOTIFICATION_PREFERENCES_VIEWED,
event_data
)


def notification_generated_event(user_ids, app_name, notification_type, course_key,
content_url, content, sender_id=None):
"""
Expand Down
Loading