Skip to content

Commit

Permalink
fix(docs): fix code indentation in serializers.md
Browse files Browse the repository at this point in the history
It fixes the indentation of `restore_object()` in the section "Specifying which fields should be write-only" serializers documentation.
  • Loading branch information
theskumar committed Feb 18, 2014
1 parent d328f18 commit b3aa512
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/api-guide/serializers.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,14 +383,14 @@ You may wish to specify multiple fields as write-only. Instead of adding each f
fields = ('email', 'username', 'password')
write_only_fields = ('password',) # Note: Password field is write-only

def restore_object(self, attrs, instance=None):
"""
Instantiate a new User instance.
"""
assert instance is None, 'Cannot update users with CreateUserSerializer'
user = User(email=attrs['email'], username=attrs['username'])
user.set_password(attrs['password'])
return user
def restore_object(self, attrs, instance=None):
"""
Instantiate a new User instance.
"""
assert instance is None, 'Cannot update users with CreateUserSerializer'
user = User(email=attrs['email'], username=attrs['username'])
user.set_password(attrs['password'])
return user

## Specifying fields explicitly

Expand Down

0 comments on commit b3aa512

Please sign in to comment.