From fe7266097f19a614432abecebb5cb69675b87126 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Sat, 30 Jun 2012 12:07:55 +0200 Subject: [PATCH] #249 improve assignment PDF --- openslides/assignment/views.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openslides/assignment/views.py b/openslides/assignment/views.py index 209d825e4..9eaa42305 100644 --- a/openslides/assignment/views.py +++ b/openslides/assignment/views.py @@ -334,14 +334,15 @@ class AssignmentPDF(PDFView): if preamble: story.append(Paragraph("%s" % preamble.replace('\r\n','
'), stylesheet['Paragraph'])) story.append(Spacer(0,0.75*cm)) - if not Assignment.objects.exists(): # No assignments existing - story.append(Paragraph(_("No elections existing."), stylesheet['Heading3'])) + assignments = Assignment.objects.order_by('name') + if not assignments: # No assignments existing + story.append(Paragraph(_("No assignments available."), stylesheet['Heading3'])) else: # Print all assignments # List of assignments - for assignment in Assignment.objects.order_by('name'): + for assignment in assignments: story.append(Paragraph(assignment.name, stylesheet['Heading3'])) # Assignment details (each assignment on single page) - for assignment in Assignment.objects.order_by('name'): + for assignment in assignments: story.append(PageBreak()) story = self.get_assignment(assignment, story) else: # print selected assignment