1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.8.x] Fixed #15321 -- Honored ancestors unique checks.

Thanks to Tim for the review.

Backport of 79f27f2b61 from master
This commit is contained in:
Aron Podrigal
2015-01-21 22:15:59 -05:00
committed by Simon Charette
parent 3e24ab6f4c
commit fc49e73648
3 changed files with 55 additions and 4 deletions

View File

@@ -939,7 +939,7 @@ class Model(six.with_metaclass(ModelBase)):
unique_checks = []
unique_togethers = [(self.__class__, self._meta.unique_together)]
for parent_class in self._meta.parents.keys():
for parent_class in self._meta.get_parent_list():
if parent_class._meta.unique_together:
unique_togethers.append((parent_class, parent_class._meta.unique_together))
@@ -959,7 +959,7 @@ class Model(six.with_metaclass(ModelBase)):
# the list of checks.
fields_with_class = [(self.__class__, self._meta.local_fields)]
for parent_class in self._meta.parents.keys():
for parent_class in self._meta.get_parent_list():
fields_with_class.append((parent_class, parent_class._meta.local_fields))
for model_class, fields in fields_with_class: