#26816: BaseModelAdminChecks._check_inlines_item may raise AttributeError
--------------------------------------+--------------------
     Reporter:  kezabelle             |      Owner:  nobody
         Type:  Bug                   |     Status:  new
    Component:  Core (System checks)  |    Version:  1.9
     Severity:  Normal                |   Keywords:
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+--------------------
 given something like:
 {{{
 class MyInline(object): pass

 class MyModelAdmin(admin.ModelAdmin):
     inlines = [MyInline]
 }}}
 '''admin.E104''' will be added to the error stack because its not a
 subclass (ugh) of BaseModelAdmin.

 changing to:
 {{{
 class MyInline(BaseModelAdmin): pass
 }}}
 will throw:
 {{{
 AttributeError: type object 'MyInline'  has no attribute 'model'
 }}}
 because its not until `ModelAdmin` or `InlineModelAdmin` that the
 attribute is set (in `__init__` for `ModelAdmin`, as a class attribute for
 `InlineModelAdmin`)

 Encountered on 1.9, but looks to be the same in master.

--
Ticket URL: <https://code.djangoproject.com/ticket/26816>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.a154879d9500221b5e0b46ca509e199b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to