#22886 closed Bug (worksforme)

Message wording when unique_together rises

Reported by: Tuttle Owned by: nobody
Component: Internationalization Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: yes

Description

This one is IMHO not bound exactly to i18n as I think the msgid itself could be improved too.

db/models/base.py:991:

# unique_together
else:
    field_labels = [capfirst(opts.get_field(f).verbose_name) for f in unique_check]
    params['field_labels'] = six.text_type(get_text_list(field_labels, _('and')))
    return ValidationError(
        message=_("%(model_name)s with this %(field_labels)s already exists."),
        code='unique_together',
        params=params,
    )

For single field_label (one unique field constraint) there is a different msgid.

This one is used for the unique_together constraint so I'd expect 'these ... exist' or my favorite 'this combination of fields ... exists' would be better.

Change History (2)

comment:1 Changed 14 months ago by timo

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I think the current version makes sense, e.g. "Book with this Title and Author already exists.".

As for your alternative suggestions:

"Book with these Title and Author exist." isn't correct.

"Book with this combination of Title and Author exists." seems okay, but I'm not sure it's much of an upgrade over the existing text.

comment:2 Changed 14 months ago by timo

  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top