From 2324cc7b16678916c418d7137fec2a91db03b86b Mon Sep 17 00:00:00 2001 From: Henry Oforeh Date: Fri, 6 Oct 2023 14:56:54 -0600 Subject: [PATCH] [MDS-5536] Fix bug on division by zero (#2707) fix bug. --- .../app/api/document_generation/models/document_template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core-api/app/api/document_generation/models/document_template.py b/services/core-api/app/api/document_generation/models/document_template.py index 9ac966d0ae..4654f1915e 100644 --- a/services/core-api/app/api/document_generation/models/document_template.py +++ b/services/core-api/app/api/document_generation/models/document_template.py @@ -117,8 +117,8 @@ def insert_images(doc, template_data): raise Exception('Image data is not a valid Base64 string') image_bytes = io.BytesIO(image_data) - width = Inches(image['width']) if image['width'] else None - height = Inches(image['height']) if image['height'] else None + width = Inches(image['width']) if image['width'] else Inches(7.5) + height = Inches(image['height']) if image['height'] else Inches(11) paragraph.clear() run = paragraph.add_run() run.add_picture(image_bytes, width=width, height=height)