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
755241f5
Commit
755241f5
authored
Dec 09, 2014
by
John Eskew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upon fail-over check, change asset metadata document to new format.
parent
5110632e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
common/lib/xmodule/xmodule/modulestore/mongo/base.py
+10
-0
No files found.
common/lib/xmodule/xmodule/modulestore/mongo/base.py
View file @
755241f5
...
...
@@ -1483,6 +1483,16 @@ class MongoModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase, Mongo
# Not found, so create.
course_assets
=
{
'course_id'
:
unicode
(
course_key
),
'assets'
:
{}}
course_assets
[
'assets'
][
'_id'
]
=
self
.
asset_collection
.
insert
(
course_assets
)
elif
isinstance
(
course_assets
[
'assets'
],
list
):
# This record is in the old course assets format.
# Ensure that no data exists before updating the format.
assert
(
len
(
course_assets
[
'assets'
]),
0
)
# Update the format to a dict.
self
.
asset_collection
.
update
(
{
'_id'
:
course_assets
[
'_id'
]},
{
'$set'
:
{
'assets'
:
{}}}
)
course_assets
[
'assets'
]
=
{
'_id'
:
course_assets
[
'_id'
]}
else
:
course_assets
[
'assets'
][
'_id'
]
=
course_assets
[
'_id'
]
...
...
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