Duplicate item in Studio should also duplicate related xblock aside

This commit is contained in:
Dmitry Viskov
2016-03-17 17:03:39 +03:00
parent b91f940af7
commit 8f1a4ccad3
3 changed files with 214 additions and 83 deletions

View File

@@ -47,7 +47,7 @@ class SplitMongoKVS(InheritanceKeyValueStore):
def get(self, key):
if key.block_family == XBlockAside.entry_point:
if key.scope not in [Scope.settings, Scope.content]:
if key.scope not in self.VALID_SCOPES:
raise InvalidScopeError(key, self.VALID_SCOPES)
if key.block_scope_id.block_type not in self.aside_fields:
@@ -139,6 +139,9 @@ class SplitMongoKVS(InheritanceKeyValueStore):
Is the given field explicitly set in this kvs (not inherited nor default)
"""
# handle any special cases
if key.scope not in self.VALID_SCOPES:
return False
if key.scope == Scope.content:
self._load_definition()
elif key.scope == Scope.parent: