Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
326a1221
Commit
326a1221
authored
Nov 12, 2014
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove over optimization which didn't work correctly
Added story PLAT-293 to do it correctly. This fixes TNL-764
parent
d981f98b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
31 deletions
+31
-31
common/lib/xmodule/xmodule/modulestore/mongo/base.py
+1
-5
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
+22
-20
common/lib/xmodule/xmodule/modulestore/tests/test_publish.py
+8
-6
No files found.
common/lib/xmodule/xmodule/modulestore/mongo/base.py
View file @
326a1221
...
...
@@ -20,7 +20,6 @@ import re
from
uuid
import
uuid4
from
bson.son
import
SON
from
contracts
import
contract
,
new_contract
from
datetime
import
datetime
from
fs.osfs
import
OSFS
from
mongodb_proxy
import
MongoProxy
,
autoretry_read
...
...
@@ -1237,10 +1236,7 @@ class MongoModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase, Mongo
# update subtree edited info for ancestors
# don't update the subtree info for descendants of the publish root for efficiency
if
(
(
not
isPublish
or
(
isPublish
and
is_publish_root
))
and
not
self
.
_is_in_bulk_operation
(
xblock
.
location
.
course_key
)
):
if
not
isPublish
or
(
isPublish
and
is_publish_root
):
ancestor_payload
=
{
'edit_info.subtree_edited_on'
:
now
,
'edit_info.subtree_edited_by'
:
user_id
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
View file @
326a1221
...
...
@@ -1432,25 +1432,26 @@ class TestMixedModuleStore(CourseComparisonTest):
self
.
assertLess
(
node
.
subtree_edited_on
,
subtree_before
)
self
.
assertEqual
(
node
.
subtree_edited_by
,
subtree_by
)
# Create a dummy vertical & html to test against
component
=
self
.
store
.
create_child
(
self
.
user_id
,
test_course
.
location
,
'vertical'
,
block_id
=
'test_vertical'
)
child
=
self
.
store
.
create_child
(
self
.
user_id
,
component
.
location
,
'html'
,
block_id
=
'test_html'
)
sibling
=
self
.
store
.
create_child
(
self
.
user_id
,
component
.
location
,
'html'
,
block_id
=
'test_html_no_change'
)
with
self
.
store
.
bulk_operations
(
test_course
.
id
):
# Create a dummy vertical & html to test against
component
=
self
.
store
.
create_child
(
self
.
user_id
,
test_course
.
location
,
'vertical'
,
block_id
=
'test_vertical'
)
child
=
self
.
store
.
create_child
(
self
.
user_id
,
component
.
location
,
'html'
,
block_id
=
'test_html'
)
sibling
=
self
.
store
.
create_child
(
self
.
user_id
,
component
.
location
,
'html'
,
block_id
=
'test_html_no_change'
)
after_create
=
datetime
.
datetime
.
now
(
UTC
)
# Verify that all nodes were last edited in the past by create_user
...
...
@@ -1461,7 +1462,8 @@ class TestMixedModuleStore(CourseComparisonTest):
component
.
display_name
=
'Changed Display Name'
editing_user
=
self
.
user_id
-
2
component
=
self
.
store
.
update_item
(
component
,
editing_user
)
with
self
.
store
.
bulk_operations
(
test_course
.
id
):
# TNL-764 bulk ops disabled ancestor updates
component
=
self
.
store
.
update_item
(
component
,
editing_user
)
after_edit
=
datetime
.
datetime
.
now
(
UTC
)
check_node
(
component
.
location
,
after_create
,
after_edit
,
editing_user
,
after_create
,
after_edit
,
editing_user
)
# but child didn't change
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_publish.py
View file @
326a1221
...
...
@@ -24,20 +24,21 @@ class TestPublish(SplitWMongoCourseBoostrapper):
# with bulk will delay all inheritance computations which won't be added into the mongo_calls
with
self
.
draft_mongo
.
bulk_operations
(
self
.
old_course_key
):
# finds: 1 for parent to add child
# finds: 1 for parent to add child
and 2 to get ancestors
# sends: 1 for insert, 1 for parent (add child)
with
check_mongo_calls
(
1
,
2
):
with
check_mongo_calls
(
3
,
2
):
self
.
_create_item
(
'chapter'
,
'Chapter1'
,
{},
{
'display_name'
:
'Chapter 1'
},
'course'
,
'runid'
,
split
=
False
)
with
check_mongo_calls
(
2
,
2
):
with
check_mongo_calls
(
4
,
2
):
self
.
_create_item
(
'chapter'
,
'Chapter2'
,
{},
{
'display_name'
:
'Chapter 2'
},
'course'
,
'runid'
,
split
=
False
)
# For each vertical (2) created:
# - load draft
# - load non-draft
# - get last error
# - load parent
# - get ancestors
# - load inheritable data
with
check_mongo_calls
(
7
,
4
):
with
check_mongo_calls
(
15
,
6
):
self
.
_create_item
(
'vertical'
,
'Vert1'
,
{},
{
'display_name'
:
'Vertical 1'
},
'chapter'
,
'Chapter1'
,
split
=
False
)
self
.
_create_item
(
'vertical'
,
'Vert2'
,
{},
{
'display_name'
:
'Vertical 2'
},
'chapter'
,
'Chapter1'
,
split
=
False
)
# For each (4) item created
...
...
@@ -48,8 +49,9 @@ class TestPublish(SplitWMongoCourseBoostrapper):
# - load parent
# - load inheritable data
# - load parent
# - load ancestors
# count for updates increased to 16 b/c of edit_info updating
with
check_mongo_calls
(
16
,
8
):
with
check_mongo_calls
(
40
,
16
):
self
.
_create_item
(
'html'
,
'Html1'
,
"<p>Goodbye</p>"
,
{
'display_name'
:
'Parented Html'
},
'vertical'
,
'Vert1'
,
split
=
False
)
self
.
_create_item
(
'discussion'
,
'Discussion1'
,
...
...
@@ -77,7 +79,7 @@ class TestPublish(SplitWMongoCourseBoostrapper):
split
=
False
)
with
check_mongo_calls
(
0
,
2
):
with
check_mongo_calls
(
2
,
2
):
# 2 finds b/c looking for non-existent parents
self
.
_create_item
(
'static_tab'
,
'staticuno'
,
"<p>tab</p>"
,
{
'display_name'
:
'Tab uno'
},
None
,
None
,
split
=
False
)
self
.
_create_item
(
'course_info'
,
'updates'
,
"<ol><li><h2>Sep 22</h2><p>test</p></li></ol>"
,
{},
None
,
None
,
split
=
False
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment