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

feat: better reject null characters in forms #7472

Merged

Conversation

jennifer-richards
Copy link
Member

Replaces Django's forms.ModelMultipleChoiceField with a subclass that applies the ProhibitNullCharactersValidator to the submitted values before calling the superclass clean() method. This works around an apparent bug in Django that causes it to throw a server error instead of properly marking the form as invalid.

We've mostly seen this abused in the SearchForm, but I've preemptively replaced all our use of the field class.

Copy link

codecov bot commented May 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.91%. Comparing base (187c2c5) to head (201075a).
Report is 216 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7472      +/-   ##
==========================================
- Coverage   88.98%   88.91%   -0.08%     
==========================================
  Files         291      294       +3     
  Lines       40717    41196     +479     
==========================================
+ Hits        36233    36630     +397     
- Misses       4484     4566      +82     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rjsparks rjsparks merged commit 08e9539 into ietf-tools:main May 28, 2024
9 checks passed
@jennifer-richards jennifer-richards deleted the model-multiple-choice-field branch May 28, 2024 17:55
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants