mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-30 01:49:50 +03:00
Fix #6341 - BaseUniqueForValidator uses instance
Prevents partial updates to serializes with UniqueFor[Date,Month,Year]Validators from failing unnecessarily.
This commit is contained in:
parent
49984b06dc
commit
5ac5784c62
|
@ -204,6 +204,9 @@ class BaseUniqueForValidator(object):
|
|||
The `UniqueFor<Range>Validator` classes always force an implied
|
||||
'required' state on the fields they are applied to.
|
||||
"""
|
||||
if hasattr(self, "instance") and self.instance is not None:
|
||||
return
|
||||
|
||||
missing_items = {
|
||||
field_name: self.missing_message
|
||||
for field_name in [self.field, self.date_field]
|
||||
|
|
Loading…
Reference in New Issue
Block a user