Commit 47f32522 by Dennis Jen

Merge pull request #6529 from edx/release

Merge release back into master
parents ff4f0787 0e03834d
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<li class="field text required" id="field-username"> <li class="field text required" id="field-username">
<label for="username">${_("Public Username")}</label> <label for="username">${_("Public Username")}</label>
## Translators: This is the placeholder text for a field that asks the user to pick a username ## Translators: This is the placeholder text for a field that asks the user to pick a username
<input id="username" type="text" name="username" placeholder="$(_("example: JaneDoe")}" /> <input id="username" type="text" name="username" placeholder="${_("example: JaneDoe")}" />
<span class="tip tip-stacked">${_("This will be used in public discussions with your courses and in our edX101 support forums")}</span> <span class="tip tip-stacked">${_("This will be used in public discussions with your courses and in our edX101 support forums")}</span>
</li> </li>
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
</div> </div>
<div class="bit"> <div class="bit">
<h3 class="title-3">${_("How technically savvy do I need to be to create courses in {studio_name}?")}</h3> <h3 class="title-3">${_("How technically savvy do I need to be to create courses in {studio_name}?").format(studio_name=settings.STUDIO_SHORT_NAME)}</h3>
<p>${_("{studio_name} is designed to be easy to use by almost anyone familiar with common web-based authoring environments (Wordpress, Moodle, etc.). No programming knowledge is required, but for some of the more advanced features, a technical background would be helpful. As always, we are here to help, so don't hesitate to dive right in.").format( <p>${_("{studio_name} is designed to be easy to use by almost anyone familiar with common web-based authoring environments (Wordpress, Moodle, etc.). No programming knowledge is required, but for some of the more advanced features, a technical background would be helpful. As always, we are here to help, so don't hesitate to dive right in.").format(
studio_name=settings.STUDIO_SHORT_NAME, studio_name=settings.STUDIO_SHORT_NAME,
)}</p> )}</p>
......
...@@ -624,6 +624,9 @@ class DraftModuleStore(MongoModuleStore): ...@@ -624,6 +624,9 @@ class DraftModuleStore(MongoModuleStore):
return True return True
# if this block doesn't have changes, then check its children # if this block doesn't have changes, then check its children
elif xblock.has_children: elif xblock.has_children:
# fix a bug where dangling pointers should imply a change
if len(xblock.children) > len(xblock.get_children()):
return True
return any([self.has_changes(child) for child in xblock.get_children()]) return any([self.has_changes(child) for child in xblock.get_children()])
# otherwise there are no changes # otherwise there are no changes
else: else:
......
...@@ -268,8 +268,10 @@ class DraftVersioningModuleStore(SplitMongoModuleStore, ModuleStoreDraftAndPubli ...@@ -268,8 +268,10 @@ class DraftVersioningModuleStore(SplitMongoModuleStore, ModuleStoreDraftAndPubli
def has_changes_subtree(block_key): def has_changes_subtree(block_key):
draft_block = get_block(draft_course, block_key) draft_block = get_block(draft_course, block_key)
if draft_block is None: # temporary fix for bad pointers TNL-1141
return True
published_block = get_block(published_course, block_key) published_block = get_block(published_course, block_key)
if not published_block: if published_block is None:
return True return True
# check if the draft has changed since the published was created # check if the draft has changed since the published was created
......
...@@ -663,25 +663,30 @@ class TestMixedModuleStore(CourseComparisonTest): ...@@ -663,25 +663,30 @@ class TestMixedModuleStore(CourseComparisonTest):
self.assertTrue(self._has_changes(parent.location)) self.assertTrue(self._has_changes(parent.location))
self.assertTrue(self._has_changes(child.location)) self.assertTrue(self._has_changes(child.location))
@ddt.data('draft', 'split') @ddt.data(*itertools.product(
def test_has_changes_missing_child(self, default_ms): ('draft', 'split'),
(ModuleStoreEnum.Branch.draft_preferred, ModuleStoreEnum.Branch.published_only)
))
@ddt.unpack
def test_has_changes_missing_child(self, default_ms, default_branch):
""" """
Tests that has_changes() does not throw an exception when a child doesn't exist. Tests that has_changes() does not throw an exception when a child doesn't exist.
""" """
self.initdb(default_ms) self.initdb(default_ms)
# Create the parent and point it to a fake child with self.store.branch_setting(default_branch, self.course.id):
parent = self.store.create_item( # Create the parent and point it to a fake child
self.user_id, parent = self.store.create_item(
self.course.id, self.user_id,
'vertical', self.course.id,
block_id='parent', 'vertical',
) block_id='parent',
parent.children += [self.course.id.make_usage_key('vertical', 'does_not_exist')] )
parent = self.store.update_item(parent, self.user_id) parent.children += [self.course.id.make_usage_key('vertical', 'does_not_exist')]
parent = self.store.update_item(parent, self.user_id)
# Check the parent for changes should return True and not throw an exception # Check the parent for changes should return True and not throw an exception
self.assertTrue(self.store.has_changes(parent)) self.assertTrue(self.store.has_changes(parent))
# Draft # Draft
# Find: find parents (definition.children query), get parent, get course (fill in run?), # Find: find parents (definition.children query), get parent, get course (fill in run?),
......
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