Fix the request data source.

This commit is contained in:
Xavier Ordoquy 2016-01-18 18:54:00 +01:00
parent 0051492963
commit 221d6979c6

View File

@ -66,7 +66,7 @@ The following view demonstrates an example of using a serializer in a template f
def post(self, request, pk):
profile = get_object_or_404(Profile, pk=pk)
serializer = ProfileSerializer(profile, data=request.POST)
serializer = ProfileSerializer(profile, data=request.data)
if not serializer.is_valid():
return Response({'serializer': serializer, 'profile': profile})
serializer.save()