#36093: Calling full_clean() on an existing child model instance in a 
multi-table
inheritance should not execute a database query.
-------------------------------------+-------------------------------------
     Reporter:  Sage Abdullah        |                    Owner:  (none)
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):

 Does the following resolves the issue?

 {{{#!diff
 diff --git a/django/db/models/base.py b/django/db/models/base.py
 index a4d5a0d553..0f07d235a9 100644
 --- a/django/db/models/base.py
 +++ b/django/db/models/base.py
 @@ -1493,7 +1493,7 @@ def _perform_unique_checks(self, unique_checks):
                  ):
                      # no value, skip the lookup
                      continue
 -                if f in self._meta.pk_fields and not self._state.adding:
 +                if f in model_class._meta.pk_fields and not
 self._state.adding:
                      # no need to check for unique primary key when
 editing
                      continue
                  lookup_kwargs[str(field_name)] = lookup_value
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36093#comment:6>
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 visit 
https://groups.google.com/d/msgid/django-updates/01070194607c9070-953931e5-9256-4f86-ac5a-313a800c2ad9-000000%40eu-central-1.amazonses.com.

Reply via email to