From 8c4abae01e031b0c1d3cf07f467ff493f93f7fa5 Mon Sep 17 00:00:00 2001 From: Paulo Viadanna Date: Wed, 4 Sep 2024 16:39:40 -0300 Subject: [PATCH] fix: unhide discussion tab when enabling it (#677) --- openedx/core/djangoapps/discussions/serializers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openedx/core/djangoapps/discussions/serializers.py b/openedx/core/djangoapps/discussions/serializers.py index 88648a499598..8eeb7e10278a 100644 --- a/openedx/core/djangoapps/discussions/serializers.py +++ b/openedx/core/djangoapps/discussions/serializers.py @@ -354,6 +354,12 @@ def _update_course_configuration( key not in LegacySettingsSerializer.Meta.fields_cohorts ) } + # toogle discussion tab is_hidden + for tab in course.tabs: + if tab.tab_id == 'discussion' and tab.is_hidden != instance.enabled: + tab.is_hidden = not instance.enabled + save = True + break if save: modulestore().update_item(course, self.context['user_id']) return instance