Commit c67f1677 by Chris Dodge

remove imports of Mongo.py from modules. They shouldn't need them. Also, video…

remove imports of Mongo.py from modules. They shouldn't need them. Also, video captions shouldn't need special logic to compute the url rewrites as the main get_html() should do this.
parent 413aeed1
......@@ -5,8 +5,6 @@ from pkg_resources import resource_string, resource_listdir
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
from xmodule.modulestore.mongo import MongoModuleStore
from xmodule.modulestore.django import modulestore
from xmodule.contentstore.content import StaticContent
from xblock.core import Scope, String
......
......@@ -8,13 +8,7 @@ from __future__ import absolute_import
from importlib import import_module
from os import environ
# cdodge: ICK! Sorry about this but I'm not sure how to resolve. We have some unit tests which do not setup a
# Django runtime. This import expects to find a "CACHE =" in a configuration, which doesn't exist in the
# test environment
try:
from django.core.cache import get_cache, InvalidCacheBackendError
except:
pass
from django.core.cache import get_cache, InvalidCacheBackendError
from django.conf import settings
......
......@@ -8,8 +8,6 @@ from django.http import Http404
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
from xmodule.modulestore.xml import XMLModuleStore
from xmodule.modulestore.django import modulestore
from xmodule.contentstore.content import StaticContent
from xblock.core import Integer, Scope, String
......@@ -120,13 +118,6 @@ class VideoModule(VideoFields, XModule):
return self.youtube
def get_html(self):
if isinstance(modulestore(), XMLModuleStore):
# VS[compat]
# cdodge: filesystem static content support.
caption_asset_path = "/static/{0}/subs/".format(self.descriptor.data_dir)
else:
caption_asset_path = StaticContent.get_base_url_path_for_course_assets(self.location) + '/subs_'
# We normally let JS parse this, but in the case that we need a hacked
# out <object> player because YouTube has broken their <iframe> API for
# the third time in a year, we need to extract it server side.
......@@ -145,7 +136,7 @@ class VideoModule(VideoFields, XModule):
'source': self.source,
'track': self.track,
'display_name': self.display_name_with_default,
'caption_asset_path': caption_asset_path,
'caption_asset_path': "/static/subs/",
'show_captions': self.show_captions,
'start': self.start_time,
'end': self.end_time,
......
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