mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 13:14:30 +03:00
parent
9c29f5013f
commit
56e4508123
|
@ -152,7 +152,7 @@ A more complete example of extra actions:
|
|||
user = self.get_object()
|
||||
serializer = PasswordSerializer(data=request.data)
|
||||
if serializer.is_valid():
|
||||
user.set_password(serializer.data['password'])
|
||||
user.set_password(serializer.validated_data['password'])
|
||||
user.save()
|
||||
return Response({'status': 'password set'})
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user