-
Notifications
You must be signed in to change notification settings - Fork 1.1k
SHOW_TOOLBAR_CALLBACK change in django-debug-toolbar 1.8 breaks existing code and it is not documented #954
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
Comments
Cc @jdufresne you might want to take a look at this? Does the PR make sense to you? |
In my case I don't want to do the
As for changes to message, I would stick with the 404 from the resource, however... The calling panel obviously can render html, so it could:
Just a thought. This was quite frustrating, as @glasslion says. Since there is nothing that indicates the possible causes of the error and if you copy the failing url into your browser directly it works! So somehow the |
The behavior changed so that It was my mistake not documenting this breaking change, but the net effect is that panel views now check access is allowed to avoid leaking private data, which I think should remain. I think modifying the documentation to alert users to the breaking changes is the best way to handle it without reintroducing unauthorized access of panel views. |
In django-debug-toolbar 1.7 and below, the
SHOW_TOOLBAR_CALLBACK
callback is used to check both whether a request to debug-toolbar views should be authorized and whether a request is ajax.In django-debug-toolbar 1.8, the ajax check is moved into the middleware, and it raises a 404 if a request can not pass the SHOW_TOOLBAR_CALLBACK check.
So a callback written for django-debug-toolbar<=1.7 will broken debug-toolbar 1.8's ajax request. :-(
Debug-toolbar's own doc still indicates that the callback should check if the request is AJAX, it's confusing:
Because those 404s do not have explicit error messages, it is even harder to find the root cause.
The text was updated successfully, but these errors were encountered: