#16418: Class based generic DetailView tries to access non-existant _meta field
when get_object has been modified to return a ModelForm
-------------------------------------+-------------------------------------
               Reporter:  kd4ttc     |          Owner:  kd4ttc
                   Type:  Bug        |         Status:  new
              Milestone:             |      Component:  Generic views
                Version:  1.3        |       Severity:  Normal
             Resolution:             |       Keywords:  genericviews
           Triage Stage:  Accepted   |  modelform
    Needs documentation:  0          |      Has patch:  0
Patch needs improvement:  0          |    Needs tests:  0
                  UI/UX:  0          |  Easy pickings:  0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

 * stage:  Unreviewed => Accepted


Comment:

 Based on the evidence provided in the original report, I'd say this
 attempt to check if `self.object` is a model is incorrect:
 {{{
 if hasattr(self.object, '_meta'):
 }}}
 It should be replaced by something along these lines:
 {{{
 from django.db import models
 if isinstance(self.object, models.Model)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16418#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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to