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
14899b90
Commit
14899b90
authored
Mar 30, 2013
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix lms migration to be compatible with xblock
parent
24e64e39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
lms/djangoapps/lms_migration/migrate.py
+7
-4
No files found.
lms/djangoapps/lms_migration/migrate.py
View file @
14899b90
...
...
@@ -39,12 +39,14 @@ def getip(request):
def
get_commit_id
(
course
):
return
course
.
metadata
.
get
(
'GIT_COMMIT_ID'
,
'No commit id'
)
#return course.metadata.get('GIT_COMMIT_ID', 'No commit id')
return
getattr
(
course
,
'GIT_COMMIT_ID'
,
'No commit id'
)
# getattr(def_ms.courses[reload_dir], 'GIT_COMMIT_ID','No commit id')
def
set_commit_id
(
course
,
commit_id
):
course
.
metadata
[
'GIT_COMMIT_ID'
]
=
commit_id
#course.metadata['GIT_COMMIT_ID'] = commit_id
setattr
(
course
,
'GIT_COMMIT_ID'
,
commit_id
)
# setattr(def_ms.courses[reload_dir], 'GIT_COMMIT_ID', new_commit_id)
...
...
@@ -124,7 +126,8 @@ def manage_modulestores(request, reload_dir=None, commit_id=None):
#----------------------------------------
dumpfields
=
[
'definition'
,
'location'
,
'metadata'
]
#dumpfields = ['definition', 'location', 'metadata']
dumpfields
=
[
'location'
,
'metadata'
]
for
cdir
,
course
in
def_ms
.
courses
.
items
():
html
+=
'<hr width="100
%
"/>'
...
...
@@ -133,7 +136,7 @@ def manage_modulestores(request, reload_dir=None, commit_id=None):
html
+=
'<p>commit_id=
%
s</p>'
%
get_commit_id
(
course
)
for
field
in
dumpfields
:
data
=
getattr
(
course
,
field
)
data
=
getattr
(
course
,
field
,
None
)
html
+=
'<h3>
%
s</h3>'
%
field
if
type
(
data
)
==
dict
:
html
+=
'<ul>'
...
...
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