Skip to content

Commit 50749c4

Browse files
committed
Merge pull request encode#3841 from linovia/feature/3776
Fix update model example in html-and-forms.md
2 parents 6f8e0c3 + 221d697 commit 50749c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/topics/html-and-forms.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ The following view demonstrates an example of using a serializer in a template f
6666

6767
def post(self, request, pk):
6868
profile = get_object_or_404(Profile, pk=pk)
69-
serializer = ProfileSerializer(profile)
69+
serializer = ProfileSerializer(profile, data=request.data)
7070
if not serializer.is_valid():
7171
return Response({'serializer': serializer, 'profile': profile})
72+
serializer.save()
7273
return redirect('profile-list')
7374

7475
**profile_detail.html**:

0 commit comments

Comments
 (0)