-
Notifications
You must be signed in to change notification settings - Fork 148
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
Fix internal server errors on requests with unexpected parameters #1721
Fix internal server errors on requests with unexpected parameters #1721
Conversation
6086d73
to
0115fd3
Compare
Refactored a bit:
I'll add tests later. Regarding #1721 (comment) and #1721 (comment), I'd say we should stick to the intended meanings of 400 and 404, as it will make debugging easier (so no 404 for a parameter that's missing or of the wrong type) |
56ba5c0
to
42d2657
Compare
I added tests in a new commit, so you may want to review by commit. It's a rather big pile of code for the tests, partly because most of the views were completely untested before. On the bright side, these tests cover 8 views from #1630. Coverage increases by 0.5%. |
3e8aa96
to
054a9a5
Compare
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.
Haven't looked at tests yet, rest looks good
1a65179
to
3582101
Compare
b776466
to
feea880
Compare
feea880
to
6918018
Compare
can_be_deleted_by_manager can be tested in isolation for these two views
6918018
to
330c154
Compare
We had some views where users could trigger server errors if they wanted. Fix them so they result in
400 - Bad Request
s, as they should.For the views that can only be accessed by trusted users (managers, reviewers), it makes sense to keep the logging, as we would assume that the request was triggered by our code and we might want to investigate. A
SuspiciousOperation
will be logged atError
level, which we should be informed about.