diff options
author | bnewbold <bnewbold@manus.(none)> | 2007-03-21 22:02:41 -0700 |
---|---|---|
committer | bnewbold <bnewbold@manus.(none)> | 2007-03-21 22:02:41 -0700 |
commit | 28fe486b327d0e40d86e01a360feb38ff14fdc28 (patch) | |
tree | 1ff4cefbcac84c01944bdca58df822c58b7e7973 /bn_django/git_wiki | |
parent | c3522feb2202ef0e1f346da6617eafb9507e515f (diff) | |
download | bnewnet-28fe486b327d0e40d86e01a360feb38ff14fdc28.tar.gz bnewnet-28fe486b327d0e40d86e01a360feb38ff14fdc28.zip |
comments are public and pdf creation doesn't choke as bad
Diffstat (limited to 'bn_django/git_wiki')
-rw-r--r-- | bn_django/git_wiki/templates/git_wiki/item.html | 4 | ||||
-rw-r--r-- | bn_django/git_wiki/views.py | 28 |
2 files changed, 17 insertions, 15 deletions
diff --git a/bn_django/git_wiki/templates/git_wiki/item.html b/bn_django/git_wiki/templates/git_wiki/item.html index e26722d..69332fd 100644 --- a/bn_django/git_wiki/templates/git_wiki/item.html +++ b/bn_django/git_wiki/templates/git_wiki/item.html @@ -36,9 +36,9 @@ They will be lost if the item is updated.</em></p> <h3>Post a comment</h3> {% if user.is_authenticated %} -{% comment_form for git_wiki.item item.id with is_public yes %} +{% comment_form for git_wiki.item item.id with is_public true %} {% else %} -{% free_comment_form for git_wiki.item item.id with is_public yes %} +{% free_comment_form for git_wiki.item item.id with is_public true %} {% endif %} <br /> {% get_comment_list for git_wiki.item item.id as comments %} diff --git a/bn_django/git_wiki/views.py b/bn_django/git_wiki/views.py index 6eff54b..5a4efbd 100644 --- a/bn_django/git_wiki/views.py +++ b/bn_django/git_wiki/views.py @@ -119,19 +119,21 @@ def pdfitem(request, reqslug, blob=None): tmpdir = tempfile.mkdtemp() pre = i.slug().split('/') for fig in re.findall('\\includegraphics.*\{(.+)\}', parts['whole']): - if len(pre) > 1: - fig_blob = fromslug("%s/%s" % ('/'.join(pre[:-1])),fig) - else: - fig_blob = fromslug(fig) - # if might have to create subdirectories for figures - fig_pre = fig.split('/') - if len(fig_pre) > 1: - os.mkdir("%s/%s" % (tmpdir,'/'.join(fig_pre[:-1]))) - fig_file = file(str("%s/%s" % (tmpdir,fig)),'wb') - fig_blob.update() - fig_file.write(fig_blob.contents) - fig_file.close() - + try: + if len(pre) > 1: + fig_blob = fromslug("%s/%s" % ('/'.join(pre[:-1])),fig) + else: + fig_blob = fromslug(fig) + fig_blob.update() + # if might have to create subdirectories for figures + fig_pre = fig.split('/') + if len(fig_pre) > 1: + os.mkdir("%s/%s" % (tmpdir,'/'.join(fig_pre[:-1]))) + fig_file = file(str("%s/%s" % (tmpdir,fig)),'wb') + fig_file.write(fig_blob.contents) + fig_file.close() + except: + parts['whole'].replace(fig,'') hr = HttpResponse(mimetype="application/pdf") #hr = HttpResponse() hr['Content-Disposition'] = 'filename=%s.pdf' % reqslug |