Skip to content

Commit

Permalink
fix: discussion errors in the demo course for Palm (#32464)
Browse files Browse the repository at this point in the history
Discussion:
 - openedx/wg-build-test-release#276

Co-authored-by: Edward Zarecor <[email protected]>
  • Loading branch information
2 people authored and bra-i-am committed Apr 16, 2024
1 parent 0b85ecc commit f01b41d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions xmodule/discussion_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,23 @@ def student_view(self, context=None):
self.runtime.service(self, 'mako').render_lms_template('discussion/_discussion_inline.html', context)
)

if utils.is_discussion_enabled(self.course_key):
context = {
'discussion_id': self.discussion_id,
'display_name': self.display_name if self.display_name else _("Discussion"),
'user': self.django_user,
'course_id': self.course_key,
'discussion_category': self.discussion_category,
'discussion_target': self.discussion_target,
'can_create_thread': self.has_permission("create_thread"),
'can_create_comment': self.has_permission("create_comment"),
'can_create_subcomment': self.has_permission("create_sub_comment"),
'login_msg': login_msg,
}
fragment.add_content(
self.runtime.service(self, 'mako').render_template('discussion/_discussion_inline.html', context)
)

fragment.initialize_js('DiscussionInlineBlock')

return fragment
Expand Down

0 comments on commit f01b41d

Please sign in to comment.