]> git.parisson.com Git - teleforma.git/commitdiff
Fix crash on some script pdf download
authorYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 5 Jun 2024 09:06:48 +0000 (11:06 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 5 Jun 2024 09:06:48 +0000 (11:06 +0200)
teleforma/exam/views.py

index 9708159a0e72469b0a0a4ace92735ace787ff71b..145f5442182d8cac62441be8f8442cbe0a19610a 100755 (executable)
@@ -244,7 +244,8 @@ class ScriptDownloadView(ScriptMixinView, CourseAccessMixin):
         
         # merge annotation layer pdf and existing pdf
         for i, page in enumerate(existing_pdf.pages):
-            page.merge_page(new_pdf.pages[i])
+            if i < len(new_pdf.pages):
+                page.merge_page(new_pdf.pages[i])
             output.add_page(page)
 
         # finally, add annotations pages