This commit is contained in:
Artem Muterko 2017-04-25 07:06:29 +00:00 committed by GitHub
commit c8c2279c96

View File

@ -132,13 +132,6 @@ class UniqueTogetherValidator(object):
""" """
Filter the queryset to all instances matching the given attributes. Filter the queryset to all instances matching the given attributes.
""" """
# If this is an update, then any unprovided field should
# have it's value set based on the existing instance attribute.
if self.instance is not None:
for field_name in self.fields:
if field_name not in attrs:
attrs[field_name] = getattr(self.instance, field_name)
# Determine the filter keyword arguments and filter the queryset. # Determine the filter keyword arguments and filter the queryset.
filter_kwargs = { filter_kwargs = {
field_name: attrs[field_name] field_name: attrs[field_name]