MCPcopy
hub / github.com/django/django / get_unique_error_message

Method get_unique_error_message

django/forms/models.py:924–934  ·  view source on GitHub ↗
(self, unique_check)

Source from the content-addressed store, hash-verified

922 raise ValidationError(errors)
923
924 def get_unique_error_message(self, unique_check):
925 if len(unique_check) == 1:
926 return gettext("Please correct the duplicate data for %(field)s.") % {
927 "field": unique_check[0],
928 }
929 else:
930 return gettext(
931 "Please correct the duplicate data for %(field)s, which must be unique."
932 ) % {
933 "field": get_text_list(unique_check, _("and")),
934 }
935
936 def get_date_error_message(self, date_check):
937 return gettext(

Callers 2

validate_uniqueMethod · 0.95

Calls 2

gettextFunction · 0.90
get_text_listFunction · 0.90

Tested by

no test coverage detected