Skip to content

Commit 6a7d34e

Browse files
authored
Unique together checks should apply to fields that are read only, but have a default. (#4316)
1 parent 1acbc29 commit 6a7d34e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

rest_framework/serializers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,9 +1396,8 @@ def get_unique_together_validators(self):
13961396
# cannot map to a field, and must be a traversal, so we're not
13971397
# including those.
13981398
field_names = {
1399-
field.source for field in self.fields.values()
1399+
field.source for field in self._writable_fields
14001400
if (field.source != '*') and ('.' not in field.source)
1401-
and not field.read_only
14021401
}
14031402

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy