Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use a single 'provider_type' key for storing discussion provider type in course [BACKPORT][BB-9323] #722

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,11 @@ def sync_discussion_settings(course_key, user):
if (
ENABLE_NEW_STRUCTURE_DISCUSSIONS.is_enabled()
and not course.discussions_settings['provider_type'] == Provider.OPEN_EDX
and not course.discussions_settings['provider'] == Provider.OPEN_EDX
):
LOGGER.info(f"New structure is enabled, also updating {course_key} to use new provider")
course.discussions_settings['enable_graded_units'] = False
course.discussions_settings['unit_level_visibility'] = True
course.discussions_settings['provider'] = Provider.OPEN_EDX
course.discussions_settings['provider_type'] = Provider.OPEN_EDX
modulestore().update_item(course, user.id)

Expand Down
5 changes: 4 additions & 1 deletion openedx/core/djangoapps/discussions/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ def update_unit_discussion_state_from_discussion_blocks(course_key: CourseKey, u
"""
store = modulestore()
course = store.get_course(course_key)
provider = course.discussions_settings.get('provider', None)
provider = course.discussions_settings.get(
'provider_type',
course.discussions_settings.get('provider', None),
)
# Only migrate to the new discussion provider if the current provider is the legacy provider.
log.info(f"Current provider for {course_key} is {provider}")
if provider is not None and provider != Provider.LEGACY and not force:
Expand Down
Loading