Commit 42c2c721 by Xavier Antoviaque

Merge pull request #253 from aboudreault/revert-block-type-change-rebase

revert deprecated block_type change for local_resource_url
parents 31b22d2b 821e1549
......@@ -91,8 +91,8 @@ class PreviewModuleSystem(ModuleSystem): # pylint: disable=abstract-method
'suffix': suffix,
}) + '?' + query
def local_resource_url(self, block, uri, block_type=None):
return local_resource_url(block, uri, block_type)
def local_resource_url(self, block, uri):
return local_resource_url(block, uri)
class StudioUserService(object):
......
......@@ -25,11 +25,11 @@ def handler_url(block, handler_name, suffix='', query='', thirdparty=False):
return url
def local_resource_url(block, uri, block_type=None):
def local_resource_url(block, uri):
"""
local_resource_url for Studio
"""
return reverse('xblock_resource_url', kwargs={
'block_type': block_type or block.scope_ids.block_type,
'block_type': block.scope_ids.block_type,
'uri': uri,
})
......@@ -1178,13 +1178,13 @@ class DescriptorSystem(MetricsMixin, ConfigurableFragmentWrapper, Runtime): # p
# global function that the application can override.
return descriptor_global_handler_url(block, handler_name, suffix, query, thirdparty)
def local_resource_url(self, block, uri, block_type=None):
def local_resource_url(self, block, uri):
"""
See :meth:`xblock.runtime.Runtime:local_resource_url` for documentation.
"""
xmodule_runtime = getattr(block, 'xmodule_runtime', None)
if xmodule_runtime is not None:
return xmodule_runtime.local_resource_url(block, uri, block_type)
return xmodule_runtime.local_resource_url(block, uri)
else:
# Currently, Modulestore is responsible for instantiating DescriptorSystems
# This means that LMS/CMS don't have a way to define a subclass of DescriptorSystem
......
......@@ -114,12 +114,12 @@ class LmsHandlerUrls(object):
return url
def local_resource_url(self, block, uri, block_type=None):
def local_resource_url(self, block, uri):
"""
local_resource_url for Studio
"""
path = reverse('xblock_resource_url', kwargs={
'block_type': block_type or block.scope_ids.block_type,
'block_type': block.scope_ids.block_type,
'uri': uri,
})
return '//{}{}'.format(settings.SITE_NAME, path)
......
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