Commit d5455319 by Braden MacDonald Committed by Braden MacDonald

Fix mako template context error

parent fe0e8254
......@@ -164,7 +164,7 @@ class AnswerBlock(AnswerMixin, StepMixin, StudioEditableXBlockMixin, XBlock):
def mentoring_view(self, context=None):
""" Render this XBlock within a mentoring block. """
context = context or {}
context = context.copy() if context else {}
context['self'] = self
context['hide_header'] = context.get('hide_header', False) or not self.show_title
html = loader.render_template('templates/html/answer_editable.html', context)
......@@ -266,7 +266,7 @@ class AnswerRecapBlock(AnswerMixin, StudioEditableXBlockMixin, XBlock):
def mentoring_view(self, context=None):
""" Render this XBlock within a mentoring block. """
context = context or {}
context = context.copy() if context else {}
context['title'] = self.display_name
context['description'] = self.description
context['student_input'] = self.student_input
......
......@@ -95,12 +95,12 @@ class StepMixin(object):
return self._(u"Question")
def author_view(self, context):
context = context or {}
context = context.copy() if context else {}
context['hide_header'] = True
return self.mentoring_view(context)
def author_preview_view(self, context):
context = context or {}
context = context.copy() if context else {}
context['hide_header'] = True
return self.student_view(context)
......
......@@ -70,7 +70,7 @@ class MentoringTableBlock(StudioEditableXBlockMixin, StudioContainerXBlockMixin,
has_children = True
def student_view(self, context):
context = context or {}
context = context.copy() if context else {}
fragment = Fragment()
header_values = []
content_values = []
......@@ -136,7 +136,7 @@ class MentoringTableColumn(StudioEditableXBlockMixin, StudioContainerXBlockMixin
def mentoring_view(self, context=None):
""" Render this XBlock within a mentoring block. """
context = context or {}
context = context.copy() if context else {}
fragment = Fragment()
for child_id in self.children:
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