Commit 14899b90 by ichuang

fix lms migration to be compatible with xblock

parent 24e64e39
......@@ -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>'
......
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