small fix to xmodule_modifiers to fix case when filename missing

This commit is contained in:
ichuang
2012-08-06 18:34:54 -04:00
parent 24f85bf202
commit f47ab30c3f

View File

@@ -92,7 +92,7 @@ def add_histogram(get_html, module):
if settings.MITX_FEATURES.get('ENABLE_LMS_MIGRATION'):
[filepath, filename] = module.definition.get('filename','')
osfs = module.system.filestore
if osfs.exists(filename):
if filename is not None and osfs.exists(filename):
filepath = filename # if original, unmangled filename exists then use it (github doesn't like symlinks)
data_dir = osfs.root_path.rsplit('/')[-1]
edit_link = "https://github.com/MITx/%s/tree/master/%s" % (data_dir,filepath)