From d7cbc9ca24d54d1654ee84022fefdd01e6ae0ce4 Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Wed, 20 Dec 2023 13:50:32 +0100 Subject: [PATCH] [IMP] sign_biometric_oca: Encrypt data --- sign_biometric_oca/models/sign_oca_request.py | 4 ++-- .../static/src/components/biometric.esm.js | 5 +++-- .../src/components/biometric_signature_dialog.xml | 12 ++---------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/sign_biometric_oca/models/sign_oca_request.py b/sign_biometric_oca/models/sign_oca_request.py index c635a150..5abc282c 100644 --- a/sign_biometric_oca/models/sign_oca_request.py +++ b/sign_biometric_oca/models/sign_oca_request.py @@ -18,9 +18,9 @@ class SignOcaRequestSigner(models.Model): def _get_pdf_page_biometric(self, item, box): packet = BytesIO() can = canvas.Canvas(packet, pagesize=(box.getWidth(), box.getHeight())) - if not item.get("value") or not item["value"].get("svg"): + if not item.get("value"): return False - drawing = svg2rlg(BytesIO(b64decode(item["value"]["svg"]))) + drawing = svg2rlg(BytesIO(b64decode(item["value"]))) scaling_x = item["width"] / 100 * float(box.getWidth()) / drawing.width scaling_y = item["height"] / 100 * float(box.getHeight()) / drawing.height diff --git a/sign_biometric_oca/static/src/components/biometric.esm.js b/sign_biometric_oca/static/src/components/biometric.esm.js index cc8df31c..c97d2ad6 100644 --- a/sign_biometric_oca/static/src/components/biometric.esm.js +++ b/sign_biometric_oca/static/src/components/biometric.esm.js @@ -6,8 +6,9 @@ import {registry} from "@web/core/registry"; const signatureSignOca = { uploadSignature: function (parent, item, signatureItem, data) { - item.value = data; - console.log(item); + item.value = data.svg; + // TODO: Transform this in something more standard.... + parent.sensitiveData[item.id] = data.paths; parent.postIframeField(item); parent.checkFilledAll(); var next_items = _.filter( diff --git a/sign_biometric_oca/static/src/components/biometric_signature_dialog.xml b/sign_biometric_oca/static/src/components/biometric_signature_dialog.xml index db30e979..a71209dc 100644 --- a/sign_biometric_oca/static/src/components/biometric_signature_dialog.xml +++ b/sign_biometric_oca/static/src/components/biometric_signature_dialog.xml @@ -40,18 +40,10 @@ - -