1👍
✅
That particular if statement is indeed probably useless; you are right that the method can never be called without a request. The only exception would be if some other methods called this method directly, passing an empty or falsey value for the request parameter, but that does seem unlikely.
0👍
They are required. This is how Django processes the urls.
You’ll likely have an issue if you remove it as other part of the code expects this argument.
- Django custom prefetch and conditional annotate
- Set slug field form manually in views Django
- How to set WSGIPassAuthorization when serving Django via runmodwsgi
- Add db_index = True to a Django model which already has a lot of data
- Redirects in Django
Source:stackexchange.com