Condition never met on process_response with common middleware

21 views
Skip to first unread message

Tidiane

unread,
Apr 28, 2021, 6:22:33 PM4/28/21
to Django users

Hello, I'm Tidiane and I've been using Django for some months now.
I've been digging into the codebase these days to gain more familiriaty with the project and eventually contribute to the project.

I don't know if it's a bug or if there is something I am not getting right but here what I noticed:

I was looking at the coverage of the projects and found that this line is never hit which impacts the coverage of CommonMiddleware. I also attach the coverage report for the file.

Indeed the two conditions can never be met at the same time since the process_request method already handles if a slash should be appended.
When APPEND_SLASH is set to True, if we have a 404 error after process_request has been called, the condition should_redirect_with_slash can never be met.

So is there a need to do a check at the mentionned line or is there something Iam I not getting right?
_home_users_etudiant_django_django_middleware_common_py.html
Reply all
Reply to author
Forward
0 new messages