Skip to content
Snippets Groups Projects
Commit 23f2b758 authored by Feanil Patel's avatar Feanil Patel
Browse files

fix: Print more stack frames on requset tracing.

Six frames was not enough because for DRF views the request gets wrapped
in a proxy object and so we need more of the stack to see what part of
the code we're in that actually invokes the use change.
parent 5b7caf45
Branches
Tags release-2020-07-02-10.30
No related merge requests found
......@@ -535,7 +535,7 @@ def log_request_user_changes(request):
if name == 'user':
stack = inspect.stack()
# Written this way in case you need more of the stack for debugging.
location = "\n".join("%30s : %s:%d" % (t[3], t[1], t[2]) for t in stack[0:6])
location = "\n".join("%30s : %s:%d" % (t[3], t[1], t[2]) for t in stack[0:12])
if not hasattr(request, name):
original_user = value
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment