Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve django-rest-framework support #311

Closed
wants to merge 4 commits into from

Conversation

dulacp
Copy link
Contributor

@dulacp dulacp commented Oct 20, 2015

Hi guys,

I stubbled across some difficulties with DRF, and since you have an integration guide with it I think it could be helpful to bring some updates.

With multipart form requests I had an odd issue, because the request body was read by DOT before letting the form parser read it. It has been reported in #296, but no pull request associated, so here it is.

And I've added a little addition to the OAuth2Authentication class to reject non active users (thanks to @pySilver for the heads-up).

Cheers 🍻

for authentication and not pass the credentials in the request body
"""
if isinstance(request, Request):
return request.data.items()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would fail once you will start using any permission classes like TokenReadWriteScope and so on. Problem is that this perm classes will access this method and will fail if request.data is not a dictionary :) imagine request with json list payload.

p.s. DRF 2.x should be supported, where .data is not available.

@jleclanche
Copy link
Member

I'm going to have to close this PR, the library changed quite a lot and so did DRF support. If you want to PR any improvements that you deem are still necessary, please do!

@jleclanche jleclanche closed this Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants