Skip to content

Commit

Permalink
fix: don't override discussion_enabled and enable_graded_units
Browse files Browse the repository at this point in the history
  • Loading branch information
0x29a committed Sep 28, 2024
1 parent b75c2db commit b8af258
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions openedx/core/djangoapps/discussions/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ def update_unit_discussion_state_from_discussion_blocks(course_key: CourseKey, u
if vertical.location in discussable_units:
vertical.discussion_enabled = True
subsections_with_discussions.add(vertical.parent)
elif getattr(vertical, 'discussion_enabled', False):
subsections_with_discussions.add(vertical.parent)
else:
vertical.discussion_enabled = False
store.update_item(vertical, user_id)
Expand Down Expand Up @@ -256,7 +258,10 @@ def update_unit_discussion_state_from_discussion_blocks(course_key: CourseKey, u
discussion_config.unit_level_visibility = True
discussion_config.save()
# added delay of 30 minutes to allow for the course to be published
update_discussions_settings_from_course_task.apply_async(
args=[str(course_key), [str(unit) for unit in discussable_units]],
countdown=1800,
update_discussions_settings_from_course_task.apply(
args=[
str(course_key),
[str(unit) for unit in discussable_units],
[str(vertical.location) for vertical in verticals if vertical.discussion_enabled]
],
)

0 comments on commit b8af258

Please sign in to comment.