summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-08-26 13:18:17 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-08-26 13:18:17 +0200
commit2e23c46ab9846d33882aa32ceb88f862802f7da4 (patch)
treecc66112b842aa54b641dadea325d37ed936b9a52
parentbc6456c751d3ddf9b6cb229528334e26f20de47f (diff)
downloadIshtar-2e23c46ab9846d33882aa32ceb88f862802f7da4.tar.bz2
Ishtar-2e23c46ab9846d33882aa32ceb88f862802f7da4.zip
Fix encoding issues in PDF (refs #1214)
-rw-r--r--ishtar_common/models.py3
-rw-r--r--ishtar_common/views.py3
2 files changed, 2 insertions, 4 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index ac2661fe1..738e86107 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -429,10 +429,7 @@ class BaseHistorizedItem(models.Model):
def associated_filename(self):
if [True for attr in ('get_town_label', 'get_department', 'reference',
'short_class_name') if not hasattr(self, attr)]:
- print [True if hasattr(self, attr) else False for attr in ('get_town_label', 'get_department', 'reference',
- 'short_class_name') ]
return ''
- print "yata"
items = [self.get_department(), self.get_town_label(),
self.short_class_name, self.reference]
last_edition_date = self.last_edition_date
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index eda0be543..6c0f0696a 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -438,7 +438,8 @@ def show_item(model, name):
result = StringIO.StringIO()
html = content.encode('utf-8')
html = html.replace("<table", "<pdf:nextpage/><table repeat='1'")
- pdf = pisa.pisaDocument(StringIO.StringIO(html), result)
+ pdf = pisa.pisaDocument(StringIO.StringIO(html), result,
+ encoding='utf-8')
response = HttpResponse(result.getvalue(),
mimetype='application/pdf')
response['Content-Disposition'] = 'attachment; filename=%s.pdf' % \