Commit 221d6979 by Xavier Ordoquy

Fix the request data source.

parent 00514929
...@@ -66,7 +66,7 @@ The following view demonstrates an example of using a serializer in a template f ...@@ -66,7 +66,7 @@ The following view demonstrates an example of using a serializer in a template f
def post(self, request, pk): def post(self, request, pk):
profile = get_object_or_404(Profile, pk=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(): if not serializer.is_valid():
return Response({'serializer': serializer, 'profile': profile}) return Response({'serializer': serializer, 'profile': profile})
serializer.save() serializer.save()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment