File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,16 @@ Bugfixes
15
15
This version is compatible with Django 1.11 and requires Django 1.8 or
16
16
later.
17
17
18
+ **Backwards incompatible changes **
19
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20
+
21
+ * ``debug_toolbar.middleware.show_toolbar `` (the default value of setting
22
+ ``SHOW_TOOLBAR_CALLBACK ``) no longer returns ``False `` for AJAX requests.
23
+ This is to allow reusing the ``SHOW_TOOLBAR_CALLBACK `` function to verify
24
+ access to panel views requested via AJAX. Projects defining a custom
25
+ ``SHOW_TOOLBAR_CALLBACK `` should remove checks for AJAX requests in order to
26
+ continue to allow access to these panels.
27
+
18
28
Features
19
29
~~~~~~~~
20
30
Original file line number Diff line number Diff line change @@ -112,10 +112,15 @@ Toolbar options
112
112
Default: 'debug_toolbar.middleware.show_toolbar'
113
113
114
114
This is the dotted path to a function used for determining whether the
115
- toolbar should show or not. The default checks are that ``DEBUG `` must be
116
- set to ``True ``, the IP of the request must be in ``INTERNAL_IPS ``, and the
117
- request must not be an AJAX request. You can provide your own function
118
- ``callback(request) `` which returns ``True `` or ``False ``.
115
+ toolbar should show or not. The default checks are that ``DEBUG `` must be set
116
+ to ``True `` and the IP of the request must be in ``INTERNAL_IPS ``. You can
117
+ provide your own function ``callback(request) `` which returns ``True `` or
118
+ ``False ``.
119
+
120
+ For versions < 1.8, the callback should also return ``False `` for AJAX
121
+ requests. Since version 1.8, AJAX requests are checked in the middleware, not
122
+ the callback. This allows reusing the callback to verify access to panel
123
+ views requested via AJAX.
119
124
120
125
Panel options
121
126
~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments