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: unhide discussion tab when enabling it #677

Merged
Merged
Changes from 3 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
8 changes: 8 additions & 0 deletions openedx/core/djangoapps/discussions/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,14 @@ def update(self, instance: DiscussionsConfiguration, validated_data: dict) -> Di
course_overview_id=instance.context_key,
type='discussion'
).update(is_hidden=not instance.enabled)
# do the same for the modulestore representation
store = modulestore()
course = store.get_course(instance.context_key)
for tab in course.tabs:
if tab.tab_id == 'discussion':
tab.is_hidden = not instance.enabled
store.update_item(course, self.context['user_id'])
break
viadanna marked this conversation as resolved.
Show resolved Hide resolved
update_discussions_settings_from_course_task.delay(str(instance.context_key))
return instance

Expand Down
Loading