Violating unique constraint in the admin

49 views
Skip to first unread message

Fab

unread,
Oct 8, 2021, 6:34:02 AM10/8/21
to Django developers (Contributions to Django itself)
Hi,

When I violate a unique constraint in the admin I get an error page.

I know I can check this myself and show an error message when the form is cleaned but I feel like this should be handled by default.

Are there any reasons why it shouldn't show an error message on the admin page?

Cheers,

Fabian

Tim Graham

unread,
Oct 8, 2021, 8:43:58 AM10/8/21
to Django developers (Contributions to Django itself)
Hi, there have been some past discussions, e.g. https://groups.google.com/g/django-developers/c/Dju2vvbzECI/m/vYDnYekgBQAJ

Adam Johnson

unread,
Oct 8, 2021, 11:44:47 AM10/8/21
to django-d...@googlegroups.com
See also https://code.djangoproject.com/ticket/30581 which hoists constraint validation to forms in general, not just the admin.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/f9de59af-cf84-4218-a373-21fdcc0a3241n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages