Commit 316b7b87 by Tom Christie

Merge pull request #1428 from theskumar/patch-1

fix(docs): fix code indentation in serializers.md
parents d328f182 b3aa512d
...@@ -383,14 +383,14 @@ You may wish to specify multiple fields as write-only. Instead of adding each f ...@@ -383,14 +383,14 @@ You may wish to specify multiple fields as write-only. Instead of adding each f
fields = ('email', 'username', 'password') fields = ('email', 'username', 'password')
write_only_fields = ('password',) # Note: Password field is write-only write_only_fields = ('password',) # Note: Password field is write-only
def restore_object(self, attrs, instance=None): def restore_object(self, attrs, instance=None):
""" """
Instantiate a new User instance. Instantiate a new User instance.
""" """
assert instance is None, 'Cannot update users with CreateUserSerializer' assert instance is None, 'Cannot update users with CreateUserSerializer'
user = User(email=attrs['email'], username=attrs['username']) user = User(email=attrs['email'], username=attrs['username'])
user.set_password(attrs['password']) user.set_password(attrs['password'])
return user return user
## Specifying fields explicitly ## Specifying fields explicitly
......
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