Code

Ticket #8778: validate-unique-field-labels.diff

File validate-unique-field-labels.diff, 854 bytes (added by Petr Marhoun <petr.marhoun@…>, 6 years ago)
Line 
1=== modified file 'django/forms/models.py'
2--- django/forms/models.py      2008-09-01 19:08:08 +0000
3+++ django/forms/models.py      2008-09-01 22:06:14 +0000
4@@ -263,8 +263,8 @@
5                     field_labels = [self.fields[field_name].label for field_name in unique_check]
6                     field_labels = get_text_list(field_labels, _('and'))
7                     form_errors.append(
8-                        _("%(model_name)s with this %(field_label)s already exists.") % \
9-                        {'model_name': model_name, 'field_label': field_labels}
10+                        _("%(model_name)s with this %(field_labels)s already exists.") % \
11+                        {'model_name': model_name, 'field_labels': field_labels}
12                     )
13                 
14                 # Remove the data from the cleaned_data dict since it was invalid
15