Skip to content
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
2 changes: 1 addition & 1 deletion debug_toolbar/panels/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ def process_request(self, request):

def generate_stats(self, request, response):
records = collector.get_collection()
self._records[threading.currentThread()] = records
self._records[threading.current_thread()] = records
collector.clear_collection()
self.record_stats({"records": records})
2 changes: 1 addition & 1 deletion debug_toolbar/panels/staticfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def process_request(self, request):

def generate_stats(self, request, response):
used_paths = collector.get_collection()
self._paths[threading.currentThread()] = used_paths
self._paths[threading.current_thread()] = used_paths

self.record_stats(
{
Expand Down
4 changes: 2 additions & 2 deletions debug_toolbar/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,14 @@ def get_collection(self, thread=None):
is provided, returns a list for the current thread.
"""
if thread is None:
thread = threading.currentThread()
thread = threading.current_thread()
if thread not in self.collections:
self.collections[thread] = []
return self.collections[thread]

def clear_collection(self, thread=None):
if thread is None:
thread = threading.currentThread()
thread = threading.current_thread()
if thread in self.collections:
del self.collections[thread]

Expand Down