-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Async compatible redirect panel #1976
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Async compatible redirect panel #1976
Conversation
aprocess_request
method as common pattern in base panel class.
debug_toolbar/panels/redirects.py
Outdated
response = super().process_request(request) | ||
if iscoroutine(response): | ||
return self.aprocess_request(request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flow will call super().process_request twice. We probably want to avoid that. I have some ideas, but none that I know are great. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since aprocess_request
is exclusive to RedirectsPanel
- we can pass response from
process_request
inaprocess_request
as an argument. - or else we change the check from coroutine to checking request being an instance
ASGIRequest
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My preference is option 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think 2. won't work either : )
Looks good! Thanks for working with me to arrive at this solution. |
2fa6da5
to
60b742c
Compare
Description
async compatible
RedirectsPanel
.Checklist:
docs/changes.rst
.