Skip to content

Conversation

@vstoykov
Copy link
Contributor

@vstoykov vstoykov commented Jun 22, 2017

This fixes issue #5228

Actually I didn't find when args, kwargs and request are set in the dispatch and just set them before that as Django does.

P.S.
I found where "the magic happens". If we want restframework's request to be available as early as possible (before dispatch as is with Django's request object), even on normal API views then setting of djangorestframework's request can be done in as_view method (but should be done twice - once for APIView and once for ViewSet).
Even If we decided that it's not a problem django's request object to be available before dispatch (as is right now for APIView) because RestFramework supports Django 1.8+ we can remove setting of args and kwargs in dispatch, because they are already set by as_view decorator.

I can update the PR with these changes if you want?

@lovelydinosaur lovelydinosaur reopened this Jul 7, 2017
@lovelydinosaur lovelydinosaur merged commit 1a31959 into encode:master Jul 7, 2017
@lovelydinosaur
Copy link
Contributor

lovelydinosaur commented Jul 7, 2017

On reconsideration, sure let's go for it.

Thanks! (And apologies for the noise)

@lovelydinosaur lovelydinosaur added this to the 3.6.4 Release milestone Jul 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants