Skip to content

Commit f46dadb

Browse files
authored
Fix compatibility with django-debug-toolbar 2.0 (#13)
Fix compatibility with django-debug-toolbar 2.0 Fixes #8
2 parents 4055557 + 840145a commit f46dadb

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

HISTORY.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Pending Release
66

77
.. Insert new release notes below this line
88
9+
* Upgrade to support django-debug-toolbar 2.0+.
10+
911
1.1.0 (2019-09-06)
1012
------------------
1113

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
license='Simplified BSD License',
1818
packages=find_packages(),
1919
install_requires=[
20-
'django-debug-toolbar>=1.1,<2.0',
20+
'django-debug-toolbar>=2.0',
2121
'wrapt',
2222
],
2323
include_package_data=True,

template_profiler_panel/panels/template.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ def _calc_timeline(self, start, end):
144144

145145
return result
146146

147-
def process_response(self, request, response):
147+
def process_request(self, request):
148+
response = super(TemplateProfilerPanel, self).process_request(request)
149+
148150
summary = defaultdict(float)
149151

150152
# Collect stats
@@ -169,3 +171,5 @@ def process_response(self, request, response):
169171
self.record_stats(
170172
{'templates': sorted(self.templates, key=lambda d: d['start']),
171173
'summary': sorted(summary.items(), key=lambda t: -t[1])})
174+
175+
return response

0 commit comments

Comments
 (0)