From 41a539ed1f434581a6402040eb9a63cd5e6da537 Mon Sep 17 00:00:00 2001 From: ichuang Date: Sun, 27 May 2012 20:07:38 -0400 Subject: [PATCH] html_module should render_to_string from namespace "course", not "main" --- djangoapps/courseware/modules/html_module.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/djangoapps/courseware/modules/html_module.py b/djangoapps/courseware/modules/html_module.py index 77bcbb4bbc..5ef5e8d060 100644 --- a/djangoapps/courseware/modules/html_module.py +++ b/djangoapps/courseware/modules/html_module.py @@ -1,5 +1,6 @@ import json +from django.conf import settings from mitxmako.shortcuts import render_to_response, render_to_string from x_module import XModule @@ -25,7 +26,10 @@ class Module(XModule): filename="html/"+self.filename return self.filestore.open(filename).read() except: # For backwards compatibility. TODO: Remove - return render_to_string(self.filename, {'id': self.item_id}) + if settings.DEBUG: + print '[courseware.modules.html_module] filename=%s' % self.filename + #return render_to_string(self.filename, {'id': self.item_id}) + return render_to_string(self.filename, {'id': self.item_id},namespace='course') def __init__(self, system, xml, item_id, state=None): XModule.__init__(self, system, xml, item_id, state)