From 389f92487d4865e9d8dd339053fb17e00aabdc43 Mon Sep 17 00:00:00 2001 From: Marion Date: Mon, 21 Aug 2023 13:21:09 +0200 Subject: [PATCH] fix error appearing in dev environment: when the table of contense is created now an error appears. This commit attepst to avoid this error. --- .../contrib/print_proxy/mapfish_print/mapfish_print.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyramid_oereb/contrib/print_proxy/mapfish_print/mapfish_print.py b/pyramid_oereb/contrib/print_proxy/mapfish_print/mapfish_print.py index 061859cb5b..40f3c467c5 100644 --- a/pyramid_oereb/contrib/print_proxy/mapfish_print/mapfish_print.py +++ b/pyramid_oereb/contrib/print_proxy/mapfish_print/mapfish_print.py @@ -115,7 +115,10 @@ def __call__(self, value, system): pdf_reader = PdfReader(pdf) x = [] for i in range(len(pdf_reader.outline)): - x.append(pdf_reader.outline[i]['/Page']['/StructParents']) + if isinstance(pdf_reader.outline[i], list): + x.append(pdf_reader.outline[i][0]['/Page']['/StructParents']) + else: + x.append(pdf_reader.outline[i]['/Page']['/StructParents']) try: true_nb_of_toc = min(x)-1 except ValueError: