Skip to content

Commit

Permalink
Revert "do not add requests to the history until they are fully proce…
Browse files Browse the repository at this point in the history
…ssed"

This reverts commit 6398b09.
  • Loading branch information
mmerickel committed Jan 27, 2024
1 parent 6398b09 commit 0c2cf72
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
7 changes: 4 additions & 3 deletions demo/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def make_app():
settings['mako.directories'] = __name__ + ':templates'
settings['mako.module_directory'] = __name__ + ':mako_modules'
settings['debugtoolbar.reload_templates'] = True
settings['debugtoolbar.hosts'] = ['::1', '127.0.0.1']
settings['debugtoolbar.hosts'] = ['127.0.0.1']
settings['debugtoolbar.intercept_redirects'] = True
settings['debugtoolbar.exclude_prefixes'] = ['/static', '/favicon.ico']

Expand Down Expand Up @@ -139,5 +139,6 @@ def make_app():
app = make_app()

if __name__ == '__main__':
from waitress import serve
serve(app, listen='localhost:8080')
from wsgiref.simple_server import make_server
httpd = make_server('', 8080, app)
httpd.serve_forever()
1 change: 0 additions & 1 deletion demo/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
'pyramid_chameleon',
'selenium',
'SQLAlchemy',
'waitress',
]

setup(name='debugtoolbar_demo',
Expand Down
6 changes: 1 addition & 5 deletions src/pyramid_debugtoolbar/toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ def toolbar_tween(request):
request, panel_classes, global_panel_classes, default_active_panels
)
request.debug_toolbar = toolbar
request_history.put(request.pdtb_id, toolbar)

_handler = handler
for panel in toolbar.panels:
Expand Down Expand Up @@ -349,11 +350,6 @@ def toolbar_tween(request):
return response

finally:
# do not add the request until it is complete, some panels
# do not properly support rendering while the request is still
# processing
request_history.put(request.pdtb_id, toolbar)

# break circref
del request.debug_toolbar

Expand Down

0 comments on commit 0c2cf72

Please sign in to comment.