Skip to content

Commit b39bd7c

Browse files
committed
Merge pull request #2127 from marctc/patch-1
Missing quotes on validate_score example
2 parents 06fd63d + 83e556b commit b39bd7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/topics/3.0-announcement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ We strongly recommend that you use the namespaced import style of `import serial
170170
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:
171171

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

0 commit comments

Comments
 (0)