You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've found annoying bug when updated from DRF 3.1.3 to the newest 3.3.2. The bug makes many tests results misleading and useless. Sample of code for a quick view what's going on:
request=self.factory.post('/signup/application/', params)
view=views.UserSignUpView.as_view()
response=view(request)
... # <= some validation using asserts. OKprintrequest.__dict__# <= QueryDict in POST is empty. NOT OK!# running view again with the same requestresponse=view(request) # <= generates exception, because my serializer tries to use data from an empty QueryDict
Tested on 3.1.3 (OK), 3.2.5 (OK) and 3.3.2 (FAIL)
Couldn't debug enough, but in rest_framework/views.py file method APIView.dispatch returns invalid request in request = self.initialize_request(request, *args, **kwargs) (line 442).
File rest_framework/views.py didn't change from 3.2.5 to 3.3.2, but rest_framework/request.py file changed and I suppose the problem is somewhere here.
Best regards!
The text was updated successfully, but these errors were encountered:
I agree with you that it shouldn't necessarily be ok (in example with stream which you presented), but this code worked normally with two previous version lines of DRF (3.1.3 and 3.2.5), so it's quite strange.
Might be able to consider cleanup, tho as it stands the issue isn't clear to me. If you can break this down to specifically what action cannot be taken twice on the request (rather than presenting this as 'view cannot be called twice') then we could reconsider.
Hi, I've found annoying bug when updated from DRF 3.1.3 to the newest 3.3.2. The bug makes many tests results misleading and useless. Sample of code for a quick view what's going on:
Tested on 3.1.3 (OK), 3.2.5 (OK) and 3.3.2 (FAIL)
Couldn't debug enough, but in rest_framework/views.py file method
APIView.dispatch
returns invalid request inrequest = self.initialize_request(request, *args, **kwargs)
(line 442).File rest_framework/views.py didn't change from 3.2.5 to 3.3.2, but rest_framework/request.py file changed and I suppose the problem is somewhere here.
Best regards!
The text was updated successfully, but these errors were encountered: