Skip to content

Commit

Permalink
fix: update discussion enabled if true (openedx#33008)
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadadeeltajamul authored Aug 15, 2023
1 parent a5912b7 commit 4e5d3f9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions openedx/core/djangoapps/discussions/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,15 @@ def get_discussable_units(course, enable_graded_units, discussable_units=None):
for unit in get_units(subsection):
idx += 1
if not is_discussable_unit(unit, store, enable_graded_units, subsection):
unit.discussion_enabled = 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)
log.info(f"Checking discussions_enabled for {course.id}")
if unit.discussion_enabled:
unit.discussion_enabled = False
store.update_item(unit, unit.published_by, isPublish=True, emit_signals=False)
log.info(f"Updating discussions_enabled for {course.id}")
else:
unit.discussion_enabled = False
store.update_item(unit, unit.published_by, emit_signals=False)
continue
# check if discussable_units is type of list and discussable_units is empty
Expand Down

0 comments on commit 4e5d3f9

Please sign in to comment.