#26006: SingleObjectMixin.get_context_object_name refers to obj and self.object
inconsistently
--------------------------------------+--------------------
     Reporter:  chmarr                |      Owner:  nobody
         Type:  Cleanup/optimization  |     Status:  new
    Component:  Generic views         |    Version:  1.9
     Severity:  Normal                |   Keywords:
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+--------------------
 The method SingleObjectMixin.get_context_object_name refers to the 'obj'
 parameter several times, but in one instance refers to self.object in a
 seemingly inconsistent manner.

 This is probably not causing a problem, yet, since the descendant class,
 typically BaseDetailView, is setting self.object, and
 SingleObjectMixin.get_context_data simply calls
 self.get_context_object_name(self.object), so the two are _usually_ the
 same object.

 Trivial bug, and trivial fix. I'll create a pull request. Test suite
 passes both before and after the change.

--
Ticket URL: <https://code.djangoproject.com/ticket/26006>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.83db4480e3d2d0b33756dbd1bf178495%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to