From fcfaee2b4afad53ce5871fd919eb39ff5f05d0c5 Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Wed, 6 Oct 2021 11:55:27 +0200 Subject: [PATCH] Handle the case where the URL being encoded by qrcodejs is causing an error with the library (e.g. https://github.com/davidshimjs/qrcodejs/issues/78). --- .../templates/base/calculator.report.html.j2 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cara/apps/calculator/templates/base/calculator.report.html.j2 b/cara/apps/calculator/templates/base/calculator.report.html.j2 index a6180770..d06a21bc 100644 --- a/cara/apps/calculator/templates/base/calculator.report.html.j2 +++ b/cara/apps/calculator/templates/base/calculator.report.html.j2 @@ -442,13 +442,15 @@ new QRCode(document.getElementById("qrcode"), { text: "{{ permalink.shortened }}", width: 330, - height: 330} - ); - new QRCode(document.getElementById("pdf_qrcode"), { + height: 330, + correctLevel : QRCode.CorrectLevel.L + }); + new QRCode(document.getElementById("pdf_qrcode"), { text: "{{ permalink.shortened }}", width: 133, - height: 133} - ); + height: 133, + correctLevel : QRCode.CorrectLevel.L + });