bug-1928808: fix _report_type validation #6784
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes
_report_type
validation in the TopCrashers form so it doesn't create bad Super Search queries which kick up an HTTP 500.Previously, the form did no useful validation (why even have a form?). Now it enforces that
_report_type
is one of "any", "hang", or "crash" which are the only three values it should have. If it gets a different value, the form will cause the view to raise an HTTP 400 with an error saying that the_report_type
value isn't one of the available choices.I did manual testing:
http://localhost:8000/
and chose "TopCrashers" from the dropdown in the quick navigation bar_report_type
to something like "pumpkin" -- this should return an HTTP 400 error page