From 2495120d8911faf2f1b87f78d323c992ce7ec74d Mon Sep 17 00:00:00 2001 From: Ahtisham Shahid Date: Wed, 6 Dec 2023 11:05:56 +0500 Subject: [PATCH] chore: removed enable_moderation_reason_codes flag from discussion app (#33822) * chore: removed enable_moderation_reason_codes flag from discussion app --- lms/djangoapps/discussion/rest_api/api.py | 2 -- lms/djangoapps/discussion/rest_api/tests/test_api.py | 1 - .../discussion/rest_api/tests/test_views.py | 1 - lms/djangoapps/discussion/toggles.py | 11 ----------- 4 files changed, 15 deletions(-) diff --git a/lms/djangoapps/discussion/rest_api/api.py b/lms/djangoapps/discussion/rest_api/api.py index 54878d69ca37..61877f57f06a 100644 --- a/lms/djangoapps/discussion/rest_api/api.py +++ b/lms/djangoapps/discussion/rest_api/api.py @@ -101,7 +101,6 @@ has_discussion_privileges, is_commentable_divided ) -from ..toggles import ENABLE_DISCUSSION_MODERATION_REASON_CODES from .exceptions import CommentNotFoundError, DiscussionBlackOutException, DiscussionDisabledError, ThreadNotFoundError from .forms import CommentActionsForm, ThreadActionsForm, UserOrdering from .pagination import DiscussionAPIPagination @@ -365,7 +364,6 @@ def _format_datetime(dt): "enable_in_context": course_config.enable_in_context, "group_at_subsection": course_config.plugin_configuration.get("group_at_subsection", False), 'learners_tab_enabled': ENABLE_LEARNERS_TAB_IN_DISCUSSIONS_MFE.is_enabled(course_key), - "reason_codes_enabled": ENABLE_DISCUSSION_MODERATION_REASON_CODES.is_enabled(course_key), "edit_reasons": [ {"code": reason_code, "label": label} for (reason_code, label) in EDIT_REASON_CODES.items() diff --git a/lms/djangoapps/discussion/rest_api/tests/test_api.py b/lms/djangoapps/discussion/rest_api/tests/test_api.py index ebe4a429c42c..bf744738b0a2 100644 --- a/lms/djangoapps/discussion/rest_api/tests/test_api.py +++ b/lms/djangoapps/discussion/rest_api/tests/test_api.py @@ -212,7 +212,6 @@ def test_basic(self): 'is_user_admin': False, 'user_roles': {'Student'}, 'learners_tab_enabled': False, - 'reason_codes_enabled': False, 'edit_reasons': [{'code': 'test-edit-reason', 'label': 'Test Edit Reason'}], 'post_close_reasons': [{'code': 'test-close-reason', 'label': 'Test Close Reason'}], } diff --git a/lms/djangoapps/discussion/rest_api/tests/test_views.py b/lms/djangoapps/discussion/rest_api/tests/test_views.py index 806cf9b11d31..ded21536e7f6 100644 --- a/lms/djangoapps/discussion/rest_api/tests/test_views.py +++ b/lms/djangoapps/discussion/rest_api/tests/test_views.py @@ -536,7 +536,6 @@ def test_basic(self): 'is_user_admin': False, "user_roles": ["Student"], 'learners_tab_enabled': False, - "reason_codes_enabled": False, "edit_reasons": [{"code": "test-edit-reason", "label": "Test Edit Reason"}], "post_close_reasons": [{"code": "test-close-reason", "label": "Test Close Reason"}], } diff --git a/lms/djangoapps/discussion/toggles.py b/lms/djangoapps/discussion/toggles.py index 85c3cc0bf978..201cd4e7318c 100644 --- a/lms/djangoapps/discussion/toggles.py +++ b/lms/djangoapps/discussion/toggles.py @@ -24,17 +24,6 @@ f'{WAFFLE_FLAG_NAMESPACE}.enable_learners_tab_in_discussions_mfe', __name__ ) -# .. toggle_name: discussions.enable_moderation_reason_codes -# .. toggle_implementation: CourseWaffleFlag -# .. toggle_default: False -# .. toggle_description: Waffle flag to toggle support for the new edit and post close reason codes -# .. toggle_use_cases: temporary, open_edx -# .. toggle_creation_date: 2022-02-22 -# .. toggle_target_removal_date: 2022-09-22 -ENABLE_DISCUSSION_MODERATION_REASON_CODES = CourseWaffleFlag( - f'{WAFFLE_FLAG_NAMESPACE}.enable_moderation_reason_codes', __name__ -) - # .. toggle_name: discussions.enable_reported_content_email_notifications # .. toggle_implementation: CourseWaffleFlag # .. toggle_default: False