Error while exporting course with too long filename

This commit is contained in:
noraiz-anwar
2016-12-27 15:46:18 +05:00
parent 74a0d76956
commit 9c139a87a6
4 changed files with 58 additions and 4 deletions

View File

@@ -296,9 +296,11 @@ def copy_or_rename_transcript(new_name, old_name, item, delete_old=False, user=N
def get_html5_ids(html5_sources):
"""
Helper method to parse out an HTML5 source into the ideas
NOTE: This assumes that '/' are not in the filename
NOTE: This assumes that '/' are not in the filename.
Slices each id by 150, restricting too long strings as video names.
"""
html5_ids = [x.split('/')[-1].rsplit('.', 1)[0] for x in html5_sources]
html5_ids = [x.split('/')[-1].rsplit('.', 1)[0][:150] for x in html5_sources]
return html5_ids