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
ff8dca94
Commit
ff8dca94
authored
Apr 04, 2013
by
Calen Pennington
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1775 from MITx/feature/ichuang/gitreload-fix
fix lms migration to be compatible with xblock
parents
79677e92
14899b90
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 @
ff8dca94
...
...
@@ -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