#33335: Django admin error when adding new object, when using Django 4 
functional
unique constraints on model
-------------------------------+------------------------------------
     Reporter:  Hervé Le Roy   |                    Owner:  nobody
         Type:  Bug            |                   Status:  new
    Component:  contrib.admin  |                  Version:  4.0
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Accepted
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+------------------------------------
Changes (by Claude Paroz):

 * status:  closed => new
 * type:  Uncategorized => Bug
 * resolution:  needsinfo =>
 * stage:  Unreviewed => Accepted


Comment:

 I can at least confirm an issue with the error message. As the index has
 no direct field name, the pattern `A <object> with this <field_name>
 already exists` can not work. I attached my code used for testing. In this
 case, the `unique_error_message` should probably produce another
 formulation a bit more generic, like "%(model_name)s is not unique in the
 database".

 I'm not sure if this is release blocker or not.

 Hervé, your report suggest an issue also with the unicity check itself, I
 was not able to reproduce that.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33335#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.f86394a586150d8289c5f6d06c77ba68%40djangoproject.com.

Reply via email to