From 2a389b4a7ff90adba9499b8bbb67d0344963be79 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Fri, 10 Oct 2014 19:01:34 +0200 Subject: [PATCH] Fixed #1326: Assignment PDF fails when having a lot of posts. Print always 7 signature lines in assingment pdf. Added test. --- openslides/assignment/views.py | 2 +- tests/assignment/test_pdf.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/openslides/assignment/views.py b/openslides/assignment/views.py index aa35f712b..bf0eb2a93 100644 --- a/openslides/assignment/views.py +++ b/openslides/assignment/views.py @@ -364,7 +364,7 @@ class AssignmentPDF(PDFView): ".  %s" % candidate, stylesheet['Signaturefield'])) if assignment.status == "sea": - for x in range(0, 2 * assignment.posts): + for x in range(0, 7): cell2b.append( Paragraph( ".  " diff --git a/tests/assignment/test_pdf.py b/tests/assignment/test_pdf.py index 90b3f92be..85a5925c0 100644 --- a/tests/assignment/test_pdf.py +++ b/tests/assignment/test_pdf.py @@ -20,3 +20,8 @@ class AssignmentPDFTest(TestCase): Assignment.objects.create(name='assignment_name_ith8qua1Eiferoqu5ju2', description="test", posts=1) response = self.admin_client.get('/assignment/print/') self.assertEqual(response.status_code, 200) + + def test_render_many_posts(self): + Assignment.objects.create(name='assignment_name_cohZ9shaipee3Phaing4', description="test", posts=20) + response = self.admin_client.get('/assignment/print/') + self.assertEqual(response.status_code, 200)