Repository navigation
feat(audit): record a guest signer's name and email from the web form - #33
Merged
Merged
Conversation
Add Signer Name Field and Signer Email Field to the eSign settings of a Web Form. They name the form's own Data fields that hold the signer's name and email, and the audit trail records what the signer submitted there, so a guest signer is named on the timeline card and in the notification email. With a Signer Email Field set, the link's email parameter only pre-fills that field and is not recorded on its own. Unset, the signer is identified as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvdEeMiewirZ3ifFoUix5F
The Signer Name Field and Signer Email Field options were refreshed on form refresh, row removal and a row's fieldname or fieldtype change. Get Fields adds rows with add_child and refresh_field, which fire none of those events, so on a new web form built with Get Fields the selects offered none of its fields until the form was reloaded. The options are now also refreshed when either select is focused or pressed, and the selects are re-rendered only when the list changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvdEeMiewirZ3ifFoUix5F
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Guest signers were named only by email in the audit trail:
_collect_audit_datalooked the signer's name up from a User with the signer's email, so a signer with no account had no name on the timeline card or in the notification email, even when the form asked for their name.The eSign settings of a Web Form now have a Signer section with two settings:
signer_name.signer_email.Both are recorded in the eSign Communication (also as its
senderandsender_full_name). They show on the timeline card ("Document signed by ...", and Email under Signing Details) and in the audit table added to the notification email.Design
web_form.js), as for Set Property After Response.EsignWebForm.validate_signer_fieldsrefuses a field that is not on the form or is not a Data field. The audit trail records only what the signer submitted on the form.emailparameter only pre-fills that field (the signer can change it), and it is never recorded on its own. If the field is empty or invalid, the logged-in user is used, then nothing.emailparameter, then a Data field with optionsEmail, then the logged-in user, with the name taken from a matching User. If the name field is set but empty, the matching User's name is still used.sender_full_name. Values on the timeline card and in the email were already escaped._is_single_emailreplaces thevalidate_email_address(x) == xcheck. That check accepted a comma-separated list, becausevalidate_email_addressreturns the valid addresses joined by commas. This also applies to the existingemailparameter path.Nothing here touches money or payroll. The permission checks in
accept, the key validation and the signing page are unchanged.Verification
tests/test_web_form.py:acceptemailparameter does not override or fill in for the email field (invalid, multi-address or empty values)emailparameter pre-fills the configured field on the signing pagetests/test_demo.pychecks the demo settings and the audit record's name.frappe-test --ci: 105 tests pass, coverage 98.5%, testmap complete.prek run --all-filesis clean.types/doctypes.d.tsis regenerated.audit-trailwas retaken and now shows "Document signed by Dana Whitfield". The newsigner-settings(light and dark) shows the Signer section on the Web Form.Docs
The README Features, Configuration and How It Works sections and
docs/README.mdare updated. The "Guest signers have no name in the audit trail" limitation is removed. It is replaced by a note that the name and email are what the signer typed, not a verified identity.Notes
allow_editto 0 when login is not required. Saving restores it to 1 throughvalidate. It is visible in the new screenshot.Review follow-up
add_childandrefresh_field, which fire no row or field event. On a new web form built with Get Fields, the Signer Name Field and Signer Email Field selects offered none of its fields until the form was reloaded. The options are now also refreshed when either select is focused or pressed, and the selects are re-rendered only when the list changed. Checked in the desk on the demo site: after a Data row was added the way Get Fields adds one, the select still lacked it; after the select was pressed, it listed the row and kept its selected value.yarn checkandprek run --all-filesare clean.test_web_form.pyall fail against develop'sweb_form.pyandweb_form.json. The timeline card and email audit table escape the typed name.🤖 Generated with Claude Code
https://claude.ai/code/session_01SvdEeMiewirZ3ifFoUix5F