Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing quotes on validate_score example #2127

Merged
merged 1 commit into from
Nov 25, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/topics/3.0-announcement.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ We strongly recommend that you use the namespaced import style of `import serial
The `validate_<field_name>` method hooks that can be attached to serializer classes change their signature slightly and return type. Previously these would take a dictionary of all incoming data, and a key representing the field name, and would return a dictionary including the validated data for that field:

def validate_score(self, attrs, source):
if attrs[score] % 10 != 0:
if attrs['score'] % 10 != 0:
raise serializers.ValidationError('This field should be a multiple of ten.')
return attrs

Expand Down