|
4 | 4 |
|
5 | 5 | from common.djangoapps.track import contexts, segment |
6 | 6 |
|
7 | | -NOTIFICATION_PREFERENCES_VIEWED = 'edx.notifications.preferences.viewed' |
8 | 7 | NOTIFICATION_GENERATED = 'edx.notifications.generated' |
9 | 8 | NOTIFICATION_READ = 'edx.notifications.read' |
10 | 9 | NOTIFICATION_APP_ALL_READ = 'edx.notifications.app_all_read' |
@@ -46,35 +45,6 @@ def notification_event_context(user, course_id, notification): |
46 | 45 | } |
47 | 46 |
|
48 | 47 |
|
49 | | -def notification_preferences_viewed_event(request, course_id=None): |
50 | | - """ |
51 | | - Emit an event when a user views their notification preferences. |
52 | | - """ |
53 | | - event_data = { |
54 | | - 'user_id': str(request.user.id), |
55 | | - 'course_id': None, |
56 | | - 'user_forum_roles': [], |
57 | | - 'user_course_roles': [], |
58 | | - 'type': 'account' |
59 | | - } |
60 | | - if not course_id: |
61 | | - tracker.emit( |
62 | | - NOTIFICATION_PREFERENCES_VIEWED, |
63 | | - event_data |
64 | | - ) |
65 | | - return |
66 | | - context = contexts.course_context_from_course_id(course_id) |
67 | | - with tracker.get_tracker().context(NOTIFICATION_PREFERENCES_VIEWED, context): |
68 | | - event_data['course_id']: str(course_id) |
69 | | - event_data['user_forum_roles'] = get_user_forums_roles(request.user, course_id) |
70 | | - event_data['user_course_roles'] = get_user_course_roles(request.user, course_id) |
71 | | - event_data['type'] = 'course' |
72 | | - tracker.emit( |
73 | | - NOTIFICATION_PREFERENCES_VIEWED, |
74 | | - event_data |
75 | | - ) |
76 | | - |
77 | | - |
78 | 48 | def notification_generated_event(user_ids, app_name, notification_type, course_key, |
79 | 49 | content_url, content, sender_id=None): |
80 | 50 | """ |
|
0 commit comments