Commit b5a1ff3f by Braden MacDonald

Fix deepcopy error due to fix in 90d1317a not being applied everywhere

Other problem builder child blocks were adding themselves to the context, then calling context.copy() caused errors.
parent 4f5904c3
...@@ -165,7 +165,7 @@ class AnswerBlock(AnswerMixin, StepMixin, StudioEditableXBlockMixin, XBlock): ...@@ -165,7 +165,7 @@ class AnswerBlock(AnswerMixin, StepMixin, StudioEditableXBlockMixin, XBlock):
def mentoring_view(self, context=None): def mentoring_view(self, context=None):
""" Render this XBlock within a mentoring block. """ """ Render this XBlock within a mentoring block. """
context = context or {} context = context.copy() if context else {}
context['self'] = self context['self'] = self
context['hide_header'] = context.get('hide_header', False) or not self.show_title context['hide_header'] = context.get('hide_header', False) or not self.show_title
html = loader.render_template('templates/html/answer_editable.html', context) html = loader.render_template('templates/html/answer_editable.html', context)
...@@ -271,7 +271,7 @@ class AnswerRecapBlock(AnswerMixin, StudioEditableXBlockMixin, XBlock): ...@@ -271,7 +271,7 @@ class AnswerRecapBlock(AnswerMixin, StudioEditableXBlockMixin, XBlock):
def mentoring_view(self, context=None): def mentoring_view(self, context=None):
""" Render this XBlock within a mentoring block. """ """ Render this XBlock within a mentoring block. """
context = context or {} context = context.copy() if context else {}
context['title'] = self.display_name context['title'] = self.display_name
context['description'] = self.description context['description'] = self.description
context['student_input'] = self.student_input context['student_input'] = self.student_input
......
...@@ -95,12 +95,12 @@ class StepMixin(object): ...@@ -95,12 +95,12 @@ class StepMixin(object):
return self._(u"Question") return self._(u"Question")
def author_view(self, context): def author_view(self, context):
context = context or {} context = context.copy() if context else {}
context['hide_header'] = True context['hide_header'] = True
return self.mentoring_view(context) return self.mentoring_view(context)
def author_preview_view(self, context): def author_preview_view(self, context):
context = context or {} context = context.copy() if context else {}
context['hide_header'] = True context['hide_header'] = True
return self.student_view(context) return self.student_view(context)
......
...@@ -70,7 +70,7 @@ class MentoringTableBlock(StudioEditableXBlockMixin, StudioContainerXBlockMixin, ...@@ -70,7 +70,7 @@ class MentoringTableBlock(StudioEditableXBlockMixin, StudioContainerXBlockMixin,
has_children = True has_children = True
def student_view(self, context): def student_view(self, context):
context = context or {} context = context.copy() if context else {}
fragment = Fragment() fragment = Fragment()
header_values = [] header_values = []
content_values = [] content_values = []
...@@ -136,7 +136,7 @@ class MentoringTableColumn(StudioEditableXBlockMixin, StudioContainerXBlockMixin ...@@ -136,7 +136,7 @@ class MentoringTableColumn(StudioEditableXBlockMixin, StudioContainerXBlockMixin
def mentoring_view(self, context=None): def mentoring_view(self, context=None):
""" Render this XBlock within a mentoring block. """ """ Render this XBlock within a mentoring block. """
context = context or {} context = context.copy() if context else {}
fragment = Fragment() fragment = Fragment()
for child_id in self.children: for child_id in self.children:
child = self.runtime.get_block(child_id) child = self.runtime.get_block(child_id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment