From 28a2af7a2a00a45754d5f02bc7c11bb443d49fe5 Mon Sep 17 00:00:00 2001 From: Kshitij Sobti Date: Mon, 15 Nov 2021 16:06:16 +0000 Subject: [PATCH] fix!: Removes the openedx provider temporarily [BD-38] [TNL-9269] (#29314) * fix!: Removes the openedx provider temporarily UI changes to support the new provider are in progress. Once they are ready we can add back this provider. * feat: add support for hiding providers from the API response --- openedx/core/djangoapps/discussions/models.py | 1 + openedx/core/djangoapps/discussions/serializers.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/discussions/models.py b/openedx/core/djangoapps/discussions/models.py index ab25057159..cd27baac64 100644 --- a/openedx/core/djangoapps/discussions/models.py +++ b/openedx/core/djangoapps/discussions/models.py @@ -156,6 +156,7 @@ AVAILABLE_PROVIDER_MAP = { 'messages': [], 'has_full_support': True, 'supports_in_context_discussions': True, + 'visible': False, }, 'ed-discuss': { 'features': [ diff --git a/openedx/core/djangoapps/discussions/serializers.py b/openedx/core/djangoapps/discussions/serializers.py index 9041a40635..2e682b3182 100644 --- a/openedx/core/djangoapps/discussions/serializers.py +++ b/openedx/core/djangoapps/discussions/serializers.py @@ -238,7 +238,11 @@ class DiscussionsConfigurationSerializer(serializers.ModelSerializer): 'plugin_configuration': plugin_configuration, 'providers': { 'active': provider_type or DEFAULT_PROVIDER_TYPE, - 'available': AVAILABLE_PROVIDER_MAP, + 'available': { + key: value + for key, value in AVAILABLE_PROVIDER_MAP.items() + if value.get('visible', True) + }, }, }) return payload