Skip to content

Commit 87bf100

Browse files
authored
fix: remove settings.DEBUG from problem block (#37812)
* fix: remove settings.DEBUG from problem block
1 parent 1d9ca33 commit 87bf100

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

xmodule/capa_block.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ def debug(self):
535535
the error in Studio. At the same time, in production, we don't want
536536
to show errors to students.
537537
"""
538-
return getattr(self.runtime, "is_author_mode", False) or settings.DEBUG
538+
return getattr(self.runtime, "is_author_mode", False)
539539

540540
@classmethod
541541
def filter_templates(cls, template, course):

xmodule/tests/test_capa_block.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,6 +1408,7 @@ def test_submit_problem_other_errors(self):
14081408
"""
14091409
# Create the block
14101410
block = CapaFactory.create(attempts=1, user_is_staff=False)
1411+
block.runtime.is_author_mode = True
14111412

14121413
# Simulate answering a problem that raises the exception
14131414
with patch("xmodule.capa.capa_problem.LoncapaProblem.grade_answers") as mock_grade:
@@ -2516,6 +2517,7 @@ def test_get_problem_html_error_w_debug(self, render_template):
25162517
"""
25172518
render_template.return_value = "<div>Test Template HTML</div>"
25182519
block = CapaFactory.create()
2520+
block.runtime.is_author_mode = True
25192521

25202522
# Simulate throwing an exception when the capa problem
25212523
# is asked to render itself as HTML

0 commit comments

Comments
 (0)