#35551: Unique checks skipped when changing primary key
--------------------------------------------+------------------------
               Reporter:  Csirmaz Bendegúz  |          Owner:  nobody
                   Type:  Bug               |         Status:  new
              Component:  contrib.admin     |        Version:  dev
               Severity:  Normal            |       Keywords:
           Triage Stage:  Unreviewed        |      Has patch:  0
    Needs documentation:  0                 |    Needs tests:  0
Patch needs improvement:  0                 |  Easy pickings:  0
                  UI/UX:  0                 |
--------------------------------------------+------------------------
 I noticed the unique checks are skipped ({{{_perform_unique_checks}}})
 when an object's primary key is changed.

 Given:

 {{{
 # models.py
 class Dummy(models.Model):
     id = models.IntegerField(primary_key=True)

 # admin.py
 admin.site.register(Dummy)
 }}}

 1. Create Dummy (1), Dummy (2).
 2. Change Dummy (2)'s Id field -> 1
 3. No error, unique checks skipped
 4. Change Dummy (1)'s Id field -> 3
 5. A new Dummy (1) is created (why?)
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35551>
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/01070190405c0105-0802ac09-560c-44a9-b737-cc3faec9af9c-000000%40eu-central-1.amazonses.com.

Reply via email to