Skip to content

Conversation

@subnix
Copy link
Contributor

@subnix subnix commented Aug 21, 2025

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
Copy link
Member

azmeuk commented Aug 22, 2025

Thank you for your contribution!

@azmeuk azmeuk merged commit 28f4e1f into pallets-eco:main Aug 22, 2025
6 checks passed
@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