Skip to content

Commit 05e638f

Browse files
authored
Revert "Sync opencraft-release/palm.1 with Upstream 20230807-1691366566" (#574)
1 parent 8c1ed2c commit 05e638f

File tree

2 files changed

+15
-27
lines changed

2 files changed

+15
-27
lines changed

lms/djangoapps/courseware/tests/test_discussion_xblock.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
from unittest import mock
1414
import ddt
15-
from django.conf import settings
16-
from django.test.utils import override_settings
1715
from django.urls import reverse
1816
from opaque_keys.edx.keys import CourseKey
1917
from web_fragments.fragment import Fragment
@@ -169,7 +167,6 @@ def test_studio_view(self):
169167
}
170168
)
171169

172-
@override_settings(FEATURES=dict(settings.FEATURES, ENABLE_DISCUSSION_SERVICE='True'))
173170
@ddt.data(
174171
(False, False, False),
175172
(True, False, False),
@@ -234,7 +231,6 @@ def test_studio_view(self):
234231
fragment = self.block.author_view({})
235232
assert f'data-discussion-id="{self.discussion_id}"' in fragment.content
236233

237-
@override_settings(FEATURES=dict(settings.FEATURES, ENABLE_DISCUSSION_SERVICE='True'))
238234
@ddt.data(
239235
(True, False, False),
240236
(False, True, False),
@@ -294,7 +290,6 @@ def get_root(self, block):
294290
block = block.get_parent()
295291
return block
296292

297-
@override_settings(FEATURES=dict(settings.FEATURES, ENABLE_DISCUSSION_SERVICE='True'))
298293
def test_html_with_user(self):
299294
"""
300295
Test rendered DiscussionXBlock permissions.
@@ -313,7 +308,6 @@ def test_html_with_user(self):
313308
assert 'data-user-create-comment="false"' in html
314309
assert 'data-user-create-subcomment="false"' in html
315310

316-
@override_settings(FEATURES=dict(settings.FEATURES, ENABLE_DISCUSSION_SERVICE='True'))
317311
def test_discussion_render_successfully_with_orphan_parent(self):
318312
"""
319313
Test that discussion xblock render successfully
@@ -413,7 +407,6 @@ class TestXBlockQueryLoad(SharedModuleStoreTestCase):
413407
Test the number of queries executed when rendering the XBlock.
414408
"""
415409

416-
@override_settings(FEATURES=dict(settings.FEATURES, ENABLE_DISCUSSION_SERVICE='True'))
417410
def test_permissions_query_load(self):
418411
"""
419412
Tests that the permissions queries are cached when rendering numerous discussion XBlocks.

xmodule/discussion_block.py

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,6 @@ def student_view(self, context=None):
163163
"""
164164
Renders student view for LMS.
165165
"""
166-
# to prevent a circular import issue
167-
import lms.djangoapps.discussion.django_comment_client.utils as utils
168-
169166
fragment = Fragment()
170167

171168
if not self.is_visible:
@@ -192,23 +189,21 @@ def student_view(self, context=None):
192189
),
193190
)
194191

195-
if utils.is_discussion_enabled(self.course_key):
196-
context = {
197-
'discussion_id': self.discussion_id,
198-
'display_name': self.display_name if self.display_name else _("Discussion"),
199-
'user': self.django_user,
200-
'course_id': self.course_key,
201-
'discussion_category': self.discussion_category,
202-
'discussion_target': self.discussion_target,
203-
'can_create_thread': self.has_permission("create_thread"),
204-
'can_create_comment': self.has_permission("create_comment"),
205-
'can_create_subcomment': self.has_permission("create_sub_comment"),
206-
'login_msg': login_msg,
207-
}
208-
fragment.add_content(
209-
self.runtime.service(self, 'mako').render_template('discussion/_discussion_inline.html', context)
210-
)
211-
192+
context = {
193+
'discussion_id': self.discussion_id,
194+
'display_name': self.display_name if self.display_name else _("Discussion"),
195+
'user': self.django_user,
196+
'course_id': self.course_key,
197+
'discussion_category': self.discussion_category,
198+
'discussion_target': self.discussion_target,
199+
'can_create_thread': self.has_permission("create_thread"),
200+
'can_create_comment': self.has_permission("create_comment"),
201+
'can_create_subcomment': self.has_permission("create_sub_comment"),
202+
'login_msg': login_msg,
203+
}
204+
205+
fragment.add_content(self.runtime.service(self, 'mako').render_template('discussion/_discussion_inline.html',
206+
context))
212207
fragment.initialize_js('DiscussionInlineBlock')
213208

214209
return fragment

0 commit comments

Comments
 (0)