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

Replaced request.DATA with request.data for compatibility with DRF 3.2 #94

Merged
merged 1 commit into from
Aug 10, 2015

Conversation

alacritythief
Copy link
Contributor

In the latest version of DRF 3.2, request.DATA has been deprecated in favor of request.data. I've made this minor change to make it work with one of my projects.

@illing2005
Copy link

Unfortunately this doesn't fix all.
request.FILES is also deprecated in favor of request.files
And the registration uses all_auth SignupForm. And somewhere there django.view.generics.edit is used where request.FILES is used.

@alacritythief
Copy link
Contributor Author

The request.data fix is on the django-rest-auth side of things. There is no code in django-rest-auth with request.FILES and request.QUERY_PARAMS that need to be fixed.

The issue is with request.FILES is in core Django, located in django/views/generic/edit.py line 88:

85          if self.request.method in ('POST', 'PUT'):
86              kwargs.update({
87                  'data': self.request.POST,
88                  'files': self.request.FILES,
89              })
90          return kwargs

I might have to hack together a fix in DRF 3.2 in my work projects to use the downcase versions whenever they are called in upcase.

@alacritythief
Copy link
Contributor Author

Latest master of DRF fixes this:
encode/django-rest-framework#3239

@illing2005
Copy link

👍

mateusz-sikora added a commit that referenced this pull request Aug 10, 2015
Replaced request.DATA with request.data for compatibility with DRF 3.2
@mateusz-sikora mateusz-sikora merged commit 7f86c4c into Tivix:master Aug 10, 2015
scream4ik pushed a commit to scream4ik/django-rest-auth that referenced this pull request Oct 8, 2020
Added other optionals settings variables to JWT cookie
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