Fixup for Python 2.3.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8822 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2008-09-01 22:32:40 +00:00
parent fc4948d574
commit dcb0e8f959
1 changed files with 6 additions and 4 deletions

View File

@ -255,16 +255,18 @@ class BaseModelForm(BaseForm):
field_label = self.fields[field_name].label field_label = self.fields[field_name].label
# Insert the error into the error dict, very sneaky # Insert the error into the error dict, very sneaky
self._errors[field_name] = ErrorList([ self._errors[field_name] = ErrorList([
_("%(model_name)s with this %(field_label)s already exists.") % \ _(u"%(model_name)s with this %(field_label)s already exists.") % \
{'model_name': model_name, 'field_label': field_label} {'model_name': unicode(model_name),
'field_label': unicode(field_label)}
]) ])
# unique_together # unique_together
else: else:
field_labels = [self.fields[field_name].label for field_name in unique_check] field_labels = [self.fields[field_name].label for field_name in unique_check]
field_labels = get_text_list(field_labels, _('and')) field_labels = get_text_list(field_labels, _('and'))
form_errors.append( form_errors.append(
_("%(model_name)s with this %(field_label)s already exists.") % \ _(u"%(model_name)s with this %(field_label)s already exists.") % \
{'model_name': model_name, 'field_label': field_labels} {'model_name': unicode(model_name),
'field_label': unicode(field_labels)}
) )
# Remove the data from the cleaned_data dict since it was invalid # Remove the data from the cleaned_data dict since it was invalid