Commit 00514929 by Xavier Ordoquy

Merge remote-tracking branch 'shvechikov/master' into feature/3776

parents 6f8e0c3c ff0292a7
......@@ -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.POST)
if not serializer.is_valid():
return Response({'serializer': serializer, 'profile': profile})
serializer.save()
return redirect('profile-list')
**profile_detail.html**:
......
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