mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-16 19:41:06 +03:00
Fix the request data source.
This commit is contained in:
parent
0051492963
commit
221d6979c6
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user