From e6fe2332f96c5b8bd63fc1b96edd681e4a8a0fd0 Mon Sep 17 00:00:00 2001 From: Tudor Amariei Date: Fri, 23 Feb 2024 14:39:38 +0200 Subject: [PATCH] Fix form abspath --- backend/donations/pdf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/donations/pdf.py b/backend/donations/pdf.py index cf47338f..1a6c520c 100644 --- a/backend/donations/pdf.py +++ b/backend/donations/pdf.py @@ -21,7 +21,7 @@ pdfmetrics.registerFont(TTFont("OpenSans", font_path)) default_font_size = 15 -form_image_path = "/static/images/formular-2021.jpg" +form_image_path = abs_path + "/static_extras/images/formular-2021.jpg" def format_ngo_account(ngo_account: str): @@ -211,6 +211,7 @@ def create_pdf(person: Dict, ong: Dict): width, height = A4 # add the image as a background + background = ImageReader(abs_path + form_image_path) c.drawImage(background, 0, 0, width=width, height=height)