Skip to content

Documented backwards incompatible change in 1.8 #961

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

Merged
merged 1 commit into from
Sep 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ Bugfixes
This version is compatible with Django 1.11 and requires Django 1.8 or
later.

**Backwards incompatible changes**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* ``debug_toolbar.middleware.show_toolbar`` (the default value of setting
``SHOW_TOOLBAR_CALLBACK``) no longer returns ``False`` for AJAX requests.
This is to allow reusing the ``SHOW_TOOLBAR_CALLBACK`` function to verify
access to panel views requested via AJAX. Projects defining a custom
``SHOW_TOOLBAR_CALLBACK`` should remove checks for AJAX requests in order to
continue to allow access to these panels.

Features
~~~~~~~~

Expand Down
13 changes: 9 additions & 4 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,15 @@ Toolbar options
Default: 'debug_toolbar.middleware.show_toolbar'

This is the dotted path to a function used for determining whether the
toolbar should show or not. The default checks are that ``DEBUG`` must be
set to ``True``, the IP of the request must be in ``INTERNAL_IPS``, and the
request must not be an AJAX request. You can provide your own function
``callback(request)`` which returns ``True`` or ``False``.
toolbar should show or not. The default checks are that ``DEBUG`` must be set
to ``True`` and the IP of the request must be in ``INTERNAL_IPS``. You can
provide your own function ``callback(request)`` which returns ``True`` or
``False``.

For versions < 1.8, the callback should also return ``False`` for AJAX
requests. Since version 1.8, AJAX requests are checked in the middleware, not
the callback. This allows reusing the callback to verify access to panel
views requested via AJAX.

Panel options
~~~~~~~~~~~~~
Expand Down