From f757b44f706c6feea3ba39a03f5b858c7ba8cdd3 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Tue, 1 Nov 2011 08:26:37 +0100 Subject: [PATCH] Fixed error if PDF preamble is empty. --- openslides/utils/pdf.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openslides/utils/pdf.py b/openslides/utils/pdf.py index f8e27c37e..4a1c1b6cd 100755 --- a/openslides/utils/pdf.py +++ b/openslides/utils/pdf.py @@ -436,7 +436,8 @@ def print_application(request, application_id=None): title = config_get("application_pdf_title") story.append(Paragraph(title, stylesheet['Heading1'])) preamble = config_get("application_pdf_preamble") - story.append(Paragraph("%s" % preamble.replace('\r\n','
'), stylesheet['Paragraph'])) + if preamble: + story.append(Paragraph("%s" % preamble.replace('\r\n','
'), stylesheet['Paragraph'])) story.append(Spacer(0,0.75*cm)) # List of applications for application in Application.objects.order_by('number'): @@ -648,7 +649,8 @@ def print_assignment(request, assignment_id=None): title = config_get("assignment_pdf_title") story.append(Paragraph(title, stylesheet['Heading1'])) preamble = config_get("assignment_pdf_preamble") - story.append(Paragraph("%s" % preamble.replace('\r\n','
'), stylesheet['Paragraph'])) + if preamble: + story.append(Paragraph("%s" % preamble.replace('\r\n','
'), stylesheet['Paragraph'])) story.append(Spacer(0,0.75*cm)) # List of assignments for assignment in Assignment.objects.order_by('name'):