feat: send course role events to the event bus (#34158)

Notify the event bus when a user's role in a course is added or removed
This commit is contained in:
Zachary Hancock
2024-02-13 13:16:23 -05:00
committed by GitHub
parent 57b480b04f
commit 2f2ed4d6cb
6 changed files with 216 additions and 12 deletions

View File

@@ -5455,6 +5455,14 @@ EVENT_BUS_PRODUCER_CONFIG = {
# .. toggle_tickets: https://github.com/openedx/openedx-events/issues/210
'enabled': False}
},
'org.openedx.learning.user.course_access_role.added.v1': {
'learning-course-access-role-lifecycle':
{'event_key_field': 'course_access_role_data.course_key', 'enabled': False},
},
'org.openedx.learning.user.course_access_role.removed.v1': {
'learning-course-access-role-lifecycle':
{'event_key_field': 'course_access_role_data.course_key', 'enabled': False},
},
# CMS events. These have to be copied over here because cms.common adds some derived entries as well,
# and the derivation fails if the keys are missing. If we ever fully decouple the lms and cms settings,
# we can remove these.

View File

@@ -521,6 +521,15 @@ certificate_revoked_event_config['learning-certificate-lifecycle']['enabled'] =
certificate_created_event_config = EVENT_BUS_PRODUCER_CONFIG['org.openedx.learning.certificate.created.v1']
certificate_created_event_config['learning-certificate-lifecycle']['enabled'] = True
course_access_role_added_event_setting = EVENT_BUS_PRODUCER_CONFIG[
'org.openedx.learning.user.course_access_role.added.v1'
]
course_access_role_added_event_setting['learning-course-access-role-lifecycle']['enabled'] = True
course_access_role_removed_event_setting = EVENT_BUS_PRODUCER_CONFIG[
'org.openedx.learning.user.course_access_role.removed.v1'
]
course_access_role_removed_event_setting['learning-course-access-role-lifecycle']['enabled'] = True
######################## Subscriptions API SETTINGS ########################
SUBSCRIPTIONS_ROOT_URL = "http://host.docker.internal:18750"
SUBSCRIPTIONS_API_PATH = f"{SUBSCRIPTIONS_ROOT_URL}/api/v1/stripe-subscription/"