CheckboxInput.render() shouldn't catch exceptions from check_test
|Reported by:||Bruno Renié||Owned by:||nobody|
|Cc:||marc.tamlyn@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
As the docs state,
check_test is a callable that returns
True if the checkbox should be checked for a specific value. The default implementation doesn't do anything complicated and shouldn't raise exceptions. If user-provided callables break, it django shouldn't catch the error silently.
My proposal is to simply remove that bare except and let
check_test raise exceptions.
The current behaviour is actually expected and tested:
I still think it's quite a bad API and should be changed. Since that exception-swallowing behaviour isn't documented (although tested), backwards compatibility isn't that much of a concern.
Change History (5)
comment:1 Changed 4 years ago by
|Patch needs improvement:||set|
|Triage Stage:||Unreviewed → Accepted|
comment:3 Changed 4 years ago by
|Patch needs improvement:||unset|
|Triage Stage:||Accepted → Ready for checkin|