Merge pull request #1775 from MITx/feature/ichuang/gitreload-fix
fix lms migration to be compatible with xblock
This commit is contained in:
@@ -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>'
|
||||
|
||||
Reference in New Issue
Block a user