Skip to content

Commit

Permalink
Merge pull request #2127 from marctc/patch-1
Browse files Browse the repository at this point in the history
Missing quotes on validate_score example
  • Loading branch information
tomchristie committed Nov 25, 2014
2 parents 06fd63d + 83e556b commit b39bd7c
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit b39bd7c

Please sign in to comment.