Skip to content

Commit

Permalink
Improved nested update test in update().
Browse files Browse the repository at this point in the history
Closes #2194.
  • Loading branch information
tomchristie committed Dec 3, 2014
1 parent 71a8cb2 commit f2dd05a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rest_framework/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,8 @@ def create(self, validated_attrs):

def update(self, instance, validated_attrs):
assert not any(
isinstance(field, BaseSerializer) and not field.read_only
for field in self.fields.values()
isinstance(field, BaseSerializer) and (key in validated_attrs)
for key, field in self.fields.values()
), (
'The `.update()` method does not suport nested writable fields '
'by default. Write an explicit `.update()` method for serializer '
Expand Down

0 comments on commit f2dd05a

Please sign in to comment.