diff options
-rw-r--r-- | tbc/models.py | 2 | ||||
-rwxr-xr-x | tbc/views.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tbc/models.py b/tbc/models.py index 4465a4d..76c9dc6 100644 --- a/tbc/models.py +++ b/tbc/models.py @@ -38,6 +38,8 @@ ABOUT_PROJ = (("pythontbc website", "Python TBC Website"), ("posters in college", "Through Posters in College"), ("others", "Others")) + + def get_notebook_dir(instance, filename): return '%s/%s/%s' % (instance.book.contributor, instance.book.title.replace(' ', '_'), filename.replace(' ', '_')) diff --git a/tbc/views.py b/tbc/views.py index fd8fed3..0c75f96 100755 --- a/tbc/views.py +++ b/tbc/views.py @@ -605,11 +605,9 @@ def ConvertNotebook(request, notebook_path=None): try: template = path.split("/")[8:] template = "/".join(template)+notebook_name+".html" - print ("try") return render_to_response(template, {}) except: - os.popen("ipython nbconvert --to html "+path+notebook_name+".ipynb") + os.popen("ipython nbconvert --to html \""+path+notebook_name+".ipynb\"") template = path.split("/")[8:] template = "/".join(template)+notebook_name+".html" - print ("except") return render_to_response(template, {}) |