Commit 7d6d6ee2 by Victor Shnayder

Use .display_name instead of metadata['display_name']

* the former does a fallback if metadata['display_name'] isn't set.
parent 9493d786
......@@ -237,7 +237,7 @@ class CapaModule(XModule):
else:
raise
content = {'name': self.metadata['display_name'],
content = {'name': self.display_name,
'html': html,
'weight': self.weight,
}
......@@ -464,7 +464,7 @@ class CapaModule(XModule):
return {'success': msg}
log.exception("Error in capa_module problem checking")
raise Exception("error in capa_module")
self.attempts = self.attempts + 1
self.lcp.done = True
......
......@@ -140,7 +140,7 @@ class CourseDescriptor(SequenceDescriptor):
@property
def title(self):
return self.metadata['display_name']
return self.display_name
@property
def number(self):
......
......@@ -76,7 +76,7 @@ class SequenceModule(XModule):
contents.append({
'content': child.get_html(),
'title': "\n".join(
grand_child.metadata['display_name'].strip()
grand_child.display_name.strip()
for grand_child in child.get_children()
if 'display_name' in grand_child.metadata
),
......@@ -107,7 +107,7 @@ class SequenceModule(XModule):
class SequenceDescriptor(MakoModuleDescriptor, XmlDescriptor):
mako_template = 'widgets/sequence-edit.html'
module_class = SequenceModule
stores_state = True # For remembering where in the sequence the student is
@classmethod
......
......@@ -35,7 +35,7 @@ def manage_modulestores(request,reload_dir=None):
ip = request.META.get('HTTP_X_REAL_IP','') # nginx reverse proxy
if not ip:
ip = request.META.get('REMOTE_ADDR','None')
if LOCAL_DEBUG:
html += '<h3>IP address: %s ' % ip
html += '<h3>User: %s ' % request.user
......@@ -48,7 +48,7 @@ def manage_modulestores(request,reload_dir=None):
html += 'Permission denied'
html += "</body></html>"
log.debug('request denied, ALLOWED_IPS=%s' % ALLOWED_IPS)
return HttpResponse(html)
return HttpResponse(html)
#----------------------------------------
# reload course if specified
......@@ -74,10 +74,10 @@ def manage_modulestores(request,reload_dir=None):
#----------------------------------------
dumpfields = ['definition','location','metadata']
for cdir, course in def_ms.courses.items():
html += '<hr width="100%"/>'
html += '<h2>Course: %s (%s)</h2>' % (course.metadata['display_name'],cdir)
html += '<h2>Course: %s (%s)</h2>' % (course.display_name,cdir)
for field in dumpfields:
data = getattr(course,field)
......@@ -89,7 +89,7 @@ def manage_modulestores(request,reload_dir=None):
html += '</ul>'
else:
html += '<ul><li>%s</li></ul>' % escape(data)
#----------------------------------------
......@@ -107,4 +107,4 @@ def manage_modulestores(request,reload_dir=None):
log.debug('def_ms=%s' % unicode(def_ms))
html += "</body></html>"
return HttpResponse(html)
return HttpResponse(html)
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