From f2e7fc94d363b9933c536e986597f2fc5174dd82 Mon Sep 17 00:00:00 2001 From: Dan Stephenson Date: Fri, 13 Sep 2013 00:22:20 +0100 Subject: [PATCH] fix to maintain request.POST data, whilst also ensuring original change to ensure parsers are indeed called for form post --- rest_framework/request.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rest_framework/request.py b/rest_framework/request.py index b08eb9939..5611bd79b 100644 --- a/rest_framework/request.py +++ b/rest_framework/request.py @@ -150,8 +150,8 @@ class Request(object): Similar to usual behaviour of `request.POST`, except that it handles arbitrary parsers, and also works on methods other than POST (eg PUT). """ - #if not _hasattr(self, '_data'): - # self._load_data_and_files() + if not _hasattr(self, '_data'): + self._load_data_and_files() return self._data @property @@ -277,6 +277,8 @@ class Request(object): return # At this point we're committed to parsing the request as form data. + self._data = self._request.POST + self._files = self._request.FILES self._data, self._files = self._parse() # Method overloading - change the method and remove the param from the content.