From a7f9770cc1fee568d9e4a78d30b5b22c6f2df861 Mon Sep 17 00:00:00 2001 From: Muhammad Adeel Tajamul <77053848+muhammadadeeltajamul@users.noreply.github.com> Date: Thu, 10 Aug 2023 13:23:08 +0500 Subject: [PATCH] fix: set isPublish as True when creating topics in incontext discussion (#32953) --- openedx/core/djangoapps/discussions/tasks.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/discussions/tasks.py b/openedx/core/djangoapps/discussions/tasks.py index fae7f21e41..cc23192dfc 100644 --- a/openedx/core/djangoapps/discussions/tasks.py +++ b/openedx/core/djangoapps/discussions/tasks.py @@ -111,7 +111,12 @@ def get_discussable_units(course, enable_graded_units, discussable_units=None): idx += 1 if not is_discussable_unit(unit, store, enable_graded_units, subsection): unit.discussion_enabled = False - store.update_item(unit, unit.published_by, emit_signals=False) + # TODO: if and log statement will be removed after testing. + if str(course.id) == "course-v1:NedX+CMH43+2023_Summer": + log.info(f"Updating discussions_enabled for {course.id}") + store.update_item(unit, unit.published_by, isPublish=True, emit_signals=False) + else: + store.update_item(unit, unit.published_by, emit_signals=False) continue # check if discussable_units is type of list and discussable_units is empty # it means if discussable_units is empty then we should not create any topic