You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed after adding the request middleware my loging calls to some views where run twice.
I think this might be because get_response is called twice in the middleware.
( Possibly also related structure of my django app. )
The text was updated successfully, but these errors were encountered:
user-1024
changed the title
Middle ware causes double view execution
Middleware causes double view execution
Sep 24, 2022
Yes actually adding return response in the end of the if case in the middleware seems to fix this issue.
If you don't return the response the middleware will call self.get_response(request) again and this can ( depending on the middle-ware order ) cause a secondary execution of the view.
I'll make a quick pull for this.
I noticed after adding the request middleware my loging calls to some views where run twice.
I think this might be because
get_response
is called twice in the middleware.( Possibly also related structure of my django app. )
The text was updated successfully, but these errors were encountered: