diff --git a/docs/topics/html-and-forms.md b/docs/topics/html-and-forms.md index 7b8f1ccc2..6660607fe 100644 --- a/docs/topics/html-and-forms.md +++ b/docs/topics/html-and-forms.md @@ -66,9 +66,10 @@ 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) + serializer = ProfileSerializer(profile, data=request.data) if not serializer.is_valid(): return Response({'serializer': serializer, 'profile': profile}) + serializer.save() return redirect('profile-list') **profile_detail.html**: