Skip to content

fix(validators): Disabled validation with provided formdata - #880

Merged
azmeuk merged 1 commit into
pallets-eco:mainfrom
subnix:fix/disabled-validator
Aug 22, 2025
Merged

azmeuk merged 1 commit into
pallets-eco:mainfrom
subnix:fix/disabled-validator

Conversation

@subnix

@subnix subnix commented Aug 21, 2025

Copy link
Copy Markdown
Contributor

The Field.raw_data attribute has three states:

  1. None: The form data hasn't been passed.
  2. A list with a single value: The form data has been passed, and the field is present.
  3. An empty list: The form data has been passed, but the field is missing.

raw_data = None

if formdata is not None:
if self.name in formdata:
self.raw_data = formdata.getlist(self.name)
else:
self.raw_data = []

Currently, the validator correctly supports the first two states (passes the validation and fails, respectively). However, it should also support the third state, which should pass the validation.

Relates to #792 #797

@azmeuk azmeuk added the bug Unexpected behavior label Aug 22, 2025
@azmeuk

azmeuk commented Aug 22, 2025

Copy link
Copy Markdown
Member

Thank you for your contribution!

@azmeuk
azmeuk merged commit 28f4e1f into pallets-eco:main Aug 22, 2025
@subnix
subnix deleted the fix/disabled-validator branch August 22, 2025 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior

Development

Successfully merging this pull request may close these issues.

2 participants