-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Fixed ListField empty check which ignored multi-part list elements #4763
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
Fixed ListField empty check which ignored multi-part list elements #4763
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Could you include a test case that fails before this and passes after?
@tomchristie Done |
regexp = re.compile(html.HTML_LIST_REGEXP_FORMAT % re.escape(self.field_name)) | ||
if not any(regexp.match(key) for key in dictionary.keys()): | ||
return empty | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not comfortable moving the empty
check entirely inside is_html_input
- seems like we might be missing some failure cases that introduces that aren't covered by our test cases.
Any way around we could arrange this PR that has a smaller change footprint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required: Determine if there's a way to achieve this behaviour but with a less invasive change footprint.
I'm going to de-milestone for now. We'll come back to this after v3.7 |
I'm going to close this in favour of #5927. Thanks for the effort @NeveHanter! |
FIxed ListField empty check.
It was ignoring multi-part elements with parts like
emails[0]
,emails[1]
because previous check logic only checked if field name (in this exampleemails
) was in dictionary which won't match indexed list declarations.