#32733: DEFAULT_AUTO_FIELD feature leads `AbstractModel.check()` to fail with
AttributeError
-------------------------------------+-------------------------------------
               Reporter:  amureki    |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  3.2
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Here is a simple code that shows different behaviour between 3.1 and 3.2:

 {{{
 from django.db import models
 class MyAbstractModel(models.Model):
     class Meta:
         abstract = True

 # behaviour in 3.1.10:
 MyAbstractModel.check() # returns []

 # behaviour in 3.2:
 MyAbstractModel.check() # raises AttributeError: 'NoneType' object has no
 attribute 'auto_created' in `_check_default_pk`
 }}}

 It seems to me (but I might be wrong here) that this was not an
 intentional change (as the feature is all about default autofield), but
 rather a bug.
 However, feel free to correct me!

 Best,
 Rust

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32733>
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/050.1e2c5c9253d3593497beece307291111%40djangoproject.com.

Reply via email to