From 5371ee1743dcfc6322dafeb292618c0405c00510 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Tue, 26 Sep 2006 10:19:40 +0000 Subject: [PATCH] Fixed #2194 -- Tweaked error message for unique_together validator to display all verbose field names. Patch from dackze+django@gmail.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3854 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- AUTHORS | 1 + django/db/models/manipulators.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index fe2b83ac9f..225335abfd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -64,6 +64,7 @@ answer newbie questions, and generally made Django that much better: Ian Clelland crankycoder@gmail.com Matt Croydon + dackze+django@gmail.com Jonathan Daugherty (cygnus) Jason Davies (Esaj) Alex Dedul diff --git a/django/db/models/manipulators.py b/django/db/models/manipulators.py index faf453b86b..c33e703da1 100644 --- a/django/db/models/manipulators.py +++ b/django/db/models/manipulators.py @@ -300,7 +300,7 @@ def manipulator_validator_unique_together(field_name_list, opts, self, field_dat pass else: raise validators.ValidationError, _("%(object)s with this %(type)s already exists for the given %(field)s.") % \ - {'object': capfirst(opts.verbose_name), 'type': field_list[0].verbose_name, 'field': get_text_list(field_name_list[1:], 'and')} + {'object': capfirst(opts.verbose_name), 'type': field_list[0].verbose_name, 'field': get_text_list([f.verbose_name for f in field_list[1:]], 'and')} def manipulator_validator_unique_for_date(from_field, date_field, opts, lookup_type, self, field_data, all_data): from django.db.models.fields.related import ManyToOneRel