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

fix(extract_errors): fix wrong field being emitted when extracting several errors for a single object #259

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

fbessou
Copy link
Contributor

@fbessou fbessou commented Nov 8, 2024

The field variable was used both as the function argument and as a local variable that was not intended to be reused between iterations.

Renaming the function argument fixes this problem since its value is no longer modified between iterations.

You can take a look at the test BadRequestsTests.test_multiple_errors which contained an inconsistency :
a string was passed as value for the "bam" parameter whose schema was typed as "integer". The error was reported on "baz" instead of "bam".

…veral errors for a same object

The `field` variable was used both as the function argument and as a
local variable that was not intended to be reused between iterations.

Renaming the function argument fixes this problem since its value is no
longer modified between iterations.
@fbessou fbessou changed the title fix(extract_errors): fix wrong field being emitted when extracting several errors for a same object fix(extract_errors): fix wrong field being emitted when extracting several errors for a single object Nov 8, 2024
@zupo zupo merged commit b815bff into Pylons:main Nov 8, 2024
3 checks passed
@fbessou fbessou mentioned this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants