Skip to content

Commit

Permalink
fix: fixed provider not setting in course discussion settings (opened…
Browse files Browse the repository at this point in the history
…x#32863)

Co-authored-by: adeel.tajamul <[email protected]>
  • Loading branch information
muhammadadeeltajamul and adeel.tajamul authored Jul 27, 2023
1 parent 5f7d82e commit 54467b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions cms/djangoapps/contentstore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,13 +972,12 @@ def get_subsections_by_assignment_type(course_key):
return subsections_by_assignment_type


def update_course_discussions_settings(course_key):
def update_course_discussions_settings(course):
"""
Updates course provider_type when new course is created
"""
provider = DiscussionsConfiguration.get(context_key=course_key).provider_type
provider = DiscussionsConfiguration.get(context_key=course.id).provider_type
store = modulestore()
course = store.get_course(course_key)
course.discussions_settings['provider_type'] = provider
store.update_item(course, course.published_by)

Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/views/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ def create_new_course(user, org, number, run, fields):
store_for_new_course = modulestore().default_modulestore.get_modulestore_type()
new_course = create_new_course_in_store(store_for_new_course, user, org, number, run, fields)
add_organization_course(org_data, new_course.id)
update_course_discussions_settings(new_course.id)
update_course_discussions_settings(new_course)

# Enable certain fields rolling forward, where configured
if default_enable_flexible_peer_openassessments(new_course.id):
Expand Down

0 comments on commit 54467b4

Please sign in to comment.