File tree Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 1111from debug_toolbar .panels import Panel
1212from debug_toolbar .panels .history import views
1313from debug_toolbar .panels .history .forms import HistoryStoreForm
14- from debug_toolbar .toolbar import get_observe_request
1514
1615
1716class HistoryPanel (Panel ):
@@ -23,7 +22,7 @@ class HistoryPanel(Panel):
2322
2423 def get_headers (self , request ):
2524 headers = super ().get_headers (request )
26- observe_request = get_observe_request ()
25+ observe_request = self . toolbar . get_observe_request ()
2726 store_id = getattr (self .toolbar , "store_id" )
2827 if store_id and observe_request (request ):
2928 headers ["DJDT-STORE-ID" ] = store_id
Original file line number Diff line number Diff line change @@ -156,20 +156,20 @@ def is_toolbar_request(cls, request):
156156 return False
157157 return resolver_match .namespaces and resolver_match .namespaces [- 1 ] == app_name
158158
159+ @staticmethod
160+ @lru_cache
161+ def get_observe_request ():
162+ # If OBSERVE_REQUEST_CALLBACK is a string, which is the recommended
163+ # setup, resolve it to the corresponding callable.
164+ func_or_path = dt_settings .get_config ()["OBSERVE_REQUEST_CALLBACK" ]
165+ if isinstance (func_or_path , str ):
166+ return import_string (func_or_path )
167+ else :
168+ return func_or_path
169+
159170
160171def observe_request (request ):
161172 """
162- Default function to determine whether to update the toolbar from a client side request
173+ Determine whether to update the toolbar from a client side request.
163174 """
164175 return not DebugToolbar .is_toolbar_request (request )
165-
166-
167- @lru_cache ()
168- def get_observe_request ():
169- # If OBSERVE_REQUEST_CALLBACK is a string, which is the recommended
170- # setup, resolve it to the corresponding callable.
171- func_or_path = dt_settings .get_config ()["OBSERVE_REQUEST_CALLBACK" ]
172- if isinstance (func_or_path , str ):
173- return import_string (func_or_path )
174- else :
175- return func_or_path
You can’t perform that action at this time.
0 commit comments