1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Fixed #26006 -- Fixed incorrect object reference in SingleObjectMixin.get_context_object_name().

This commit is contained in:
Chris Cogdon
2015-12-29 10:58:43 -08:00
committed by Tim Graham
parent 7df9aa3a33
commit 4b2dcfe04f
5 changed files with 30 additions and 1 deletions

View File

@@ -89,7 +89,7 @@ class SingleObjectMixin(ContextMixin):
if self.context_object_name:
return self.context_object_name
elif isinstance(obj, models.Model):
if self.object._deferred:
if obj._deferred:
obj = obj._meta.proxy_for_model
return obj._meta.model_name
else: