Upgrade to the latest version of opaque-keys

This commit is contained in:
Calen Pennington
2016-11-22 10:33:57 -05:00
parent 82a2435677
commit fd0d69594a
9 changed files with 139 additions and 48 deletions

View File

@@ -55,7 +55,7 @@ setup(
'capa',
'path.py',
'webob',
'edx-opaque-keys>=0.3.4,<1.0.0',
'edx-opaque-keys>=0.4.0,<1.0.0',
],
package_data={
'xmodule': ['js/module/*'],

View File

@@ -200,7 +200,10 @@ class StaticContent(object):
if path.startswith('/static/'):
path = path[len('/static/'):]
path = path.lstrip('/')
# Old-style asset keys start with `/`, so don't try and strip it
# in that case.
if not path.startswith('/c4x'):
path = path.lstrip('/')
try:
return AssetKey.from_string(path)

View File

@@ -33,7 +33,7 @@ from xmodule.errortracker import exc_info_to_str
from xmodule.modulestore.exceptions import ItemNotFoundError
from opaque_keys.edx.keys import UsageKey
from opaque_keys.edx.asides import AsideUsageKeyV1, AsideDefinitionKeyV1
from opaque_keys.edx.asides import AsideUsageKeyV2, AsideDefinitionKeyV2
from xmodule.exceptions import UndefinedContext
import dogstats_wrapper as dog_stats_api
@@ -155,8 +155,8 @@ class AsideKeyGenerator(IdGenerator):
Returns:
(aside_definition_id, aside_usage_id)
"""
def_key = AsideDefinitionKeyV1(definition_id, aside_type)
usage_key = AsideUsageKeyV1(usage_id, aside_type)
def_key = AsideDefinitionKeyV2(definition_id, aside_type)
usage_key = AsideUsageKeyV2(usage_id, aside_type)
return (def_key, usage_key)
def create_usage(self, def_id):