Commit 87dadd40 by Chris Dodge

address some of Cale's feedback

parent 34c442a1
......@@ -377,6 +377,7 @@ class ModuleStore(object):
return courses
class ModuleStoreBase(ModuleStore):
'''
Implement interface functionality that can be shared.
......
......@@ -41,9 +41,8 @@ def import_static_content(modules, data_dir, static_content_store, target_locati
content_loc = StaticContent.compute_location(target_location_namespace.org, target_location_namespace.course, fullname_with_subpath)
mime_type = mimetypes.guess_type(filename)[0]
f = open(content_path, 'rb')
with open(content_path, 'rb') as f:
data = f.read()
f.close()
content = StaticContent(content_loc, filename, mime_type, data)
......@@ -76,9 +75,8 @@ def verify_content_links(module, base_dir, static_content_store, link, remap_dic
filename = os.path.basename(path)
mime_type = mimetypes.guess_type(filename)[0]
f = open(static_pathname, 'rb')
with open(static_pathname, 'rb') as f:
data = f.read()
f.close()
content = StaticContent(content_loc, filename, mime_type, data)
......
......@@ -363,10 +363,7 @@ def static_tab(request, course_id, tab_slug):
if tab is None:
raise Http404
cache = StudentModuleCache.cache_for_descriptor_descendents(
course.id, request.user, course, depth=2)
contents = tabs.get_static_tab_contents(request, cache, course, tab)
contents = tabs.get_static_tab_contents(request, None, course, tab)
if contents is None:
raise Http404
......
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