Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly process and validate field values from sample header on submit #2311

Merged
merged 2 commits into from
May 16, 2023

Conversation

xispa
Copy link
Member

@xispa xispa commented May 16, 2023

Description of the issue/feature this PR addresses

This Pull Request ensures the data submitted in Sample's header viewlet is properly processed by the widget and validated afterwards

Current behavior before PR

widget's process_form is not used to process the field value submitted in the form, so field validators do not receive the expected data, causing them to either fail or the validation to be ignored. This also causes the need of adding custom subscribers on_object_edited to properly handle the values (e.g.: https://github.com/senaite/senaite.patient/blob/6e41d9c169e8e35dd1bb25a46df08754942f8b32/src/senaite/patient/subscribers/analysisrequest.py#L62-L69)

Desired behavior after PR is merged

widget's process_form is used to process the field value submitted in the form, so field validators always receive the expected data

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

@ramonski ramonski merged commit 3fd052d into 2.x May 16, 2023
@ramonski ramonski deleted the validate-sample-header branch May 16, 2023 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants