[FIX] docuseal_signing: harden template copies, API errors and emails
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m31s
tests / test (pull_request) Successful in 52s

- Do not copy the contextual action nor the submitter role with a
  template: a copy sharing the action would rewrite or delete the
  original's.
- Make the template ID read-only once fetched from Docuseal: another
  Docuseal template needs a new entry.
- Report an invalid API URL or token, an unexpected (non-JSON) response
  and a connection dropped mid-response as a readable UserError.
- Refuse to email a signature request to contacts without a valid email
  address (email_normalize), before any call to Docuseal.
- Stop logging the field values and the Docuseal response, which hold
  personal data and the signing links.
- Prevent adding mapping lines by hand: they come from Docuseal only.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 17:35:19 +01:00
parent 87653552b1
commit fddc2e5c4b
7 changed files with 238 additions and 27 deletions

View File

@@ -39,7 +39,10 @@
<sheet>
<group>
<field name="name"/>
<field name="template_id"/>
<!-- Roles only exist once fetched from Docuseal: from
then on, another template needs a new entry. -->
<field name="role_ids" invisible="1"/>
<field name="template_id" readonly="role_ids"/>
<button
colspan="2"
name="action_fetch_fields"
@@ -55,7 +58,8 @@
/>
</group>
<field name="field_ids" string="Field mapping">
<list editable="bottom">
<!-- Lines come from Docuseal only: no manual creation. -->
<list editable="bottom" create="0">
<field name="sequence" widget="handle"/>
<field
name="docuseal_field_name"