fix: added admin only config in available providers (#29865)
* fix: added admin only config in available providers * fix: fixed tests
This commit is contained in:
@@ -141,7 +141,8 @@ AVAILABLE_PROVIDER_MAP = {
|
||||
contact_email='',
|
||||
)._asdict(),
|
||||
'messages': [],
|
||||
'has_full_support': True
|
||||
'has_full_support': True,
|
||||
'admin_only_config': False,
|
||||
},
|
||||
Provider.OPEN_EDX: {
|
||||
'features': [
|
||||
@@ -169,6 +170,7 @@ AVAILABLE_PROVIDER_MAP = {
|
||||
'messages': [],
|
||||
'has_full_support': True,
|
||||
'supports_in_context_discussions': True,
|
||||
'admin_only_config': False,
|
||||
},
|
||||
Provider.ED_DISCUSS: {
|
||||
'features': [
|
||||
|
||||
@@ -437,6 +437,7 @@ class DiscussionsProviderSerializer(serializers.Serializer):
|
||||
external_links = serializers.DictField(help_text="External documentation and links for provider")
|
||||
messages = serializers.ListField(child=serializers.CharField(), help_text="Custom messaging for provider")
|
||||
has_full_support = serializers.BooleanField(help_text="Whether the provider is fully supported")
|
||||
admin_only_config = serializers.BooleanField(help_text="Whether the provider can only be configured by admins")
|
||||
|
||||
|
||||
class DiscussionsFeatureSerializer(serializers.Serializer):
|
||||
|
||||
@@ -757,7 +757,6 @@ class PIISettingsAPITests(DataTest):
|
||||
data = self._configure_lti_discussion_provider(provider=provider)
|
||||
self._assert_pii_flag_for_course(enabled=False)
|
||||
expected_providers = AVAILABLE_PROVIDER_MAP[provider]
|
||||
expected_providers.pop('admin_only_config', None)
|
||||
assert data['enabled']
|
||||
assert data['provider_type'] == provider
|
||||
assert data['providers']['available'][provider] == expected_providers
|
||||
@@ -782,7 +781,6 @@ class PIISettingsAPITests(DataTest):
|
||||
self._assert_pii_flag_for_course(enabled=True)
|
||||
data = self._configure_lti_discussion_provider(provider=provider)
|
||||
expected_providers = AVAILABLE_PROVIDER_MAP[provider]
|
||||
expected_providers.pop('admin_only_config', None)
|
||||
assert data['enabled']
|
||||
assert data['provider_type'] == provider
|
||||
assert data['providers']['available'][provider] == expected_providers
|
||||
|
||||
Reference in New Issue
Block a user