summaryrefslogtreecommitdiff
path: root/django/forms/models.py
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2010-03-16 19:32:11 +0000
committerKaren Tracey <kmtracey@gmail.com>2010-03-16 19:32:11 +0000
commit47a822207f937ccafe37c0b99ab37bf2157fb4f7 (patch)
treeca2a56f9280f46b082691121ae2411a677910d1c /django/forms/models.py
parent883329ecb3b0dc025a2885813a2d1a1624261166 (diff)
Fixed #12881: Corrected handling of inherited unique constraints. Thanks for report fgaudin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12797 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/forms/models.py')
-rw-r--r--django/forms/models.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/django/forms/models.py b/django/forms/models.py
index 45a2e0cd16..13aea4acab 100644
--- a/django/forms/models.py
+++ b/django/forms/models.py
@@ -488,7 +488,7 @@ class BaseModelFormSet(BaseFormSet):
errors = []
# Do each of the unique checks (unique and unique_together)
- for unique_check in all_unique_checks:
+ for uclass, unique_check in all_unique_checks:
seen_data = set()
for form in self.forms:
# if the form doesn't have cleaned_data then we ignore it,
@@ -512,7 +512,7 @@ class BaseModelFormSet(BaseFormSet):
# iterate over each of the date checks now
for date_check in all_date_checks:
seen_data = set()
- lookup, field, unique_for = date_check
+ uclass, lookup, field, unique_for = date_check
for form in self.forms:
# if the form doesn't have cleaned_data then we ignore it,
# it's already invalid
@@ -556,9 +556,9 @@ class BaseModelFormSet(BaseFormSet):
def get_date_error_message(self, date_check):
return ugettext("Please correct the duplicate data for %(field_name)s "
"which must be unique for the %(lookup)s in %(date_field)s.") % {
- 'field_name': date_check[1],
- 'date_field': date_check[2],
- 'lookup': unicode(date_check[0]),
+ 'field_name': date_check[2],
+ 'date_field': date_check[3],
+ 'lookup': unicode(date_check[1]),
}
def get_form_error(self):