Skip to content

Commit

Permalink
Unique together checks should apply to fields that are read only, but…
Browse files Browse the repository at this point in the history
… have a default. (#4316)
  • Loading branch information
tomchristie authored Jul 27, 2016
1 parent 1acbc29 commit 6a7d34e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rest_framework/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1396,9 +1396,8 @@ def get_unique_together_validators(self):
# cannot map to a field, and must be a traversal, so we're not
# including those.
field_names = {
field.source for field in self.fields.values()
field.source for field in self._writable_fields
if (field.source != '*') and ('.' not in field.source)
and not field.read_only
}

# Note that we make sure to check `unique_together` both on the
Expand Down

0 comments on commit 6a7d34e

Please sign in to comment.