[Fixed]-Is it possible for django-rest-framework view to be called without a request object?

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.

Leave a comment