Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refs #8248 - GenericRelations descriptors now return self when access…

…ed via class

These were missed in r9550 


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9562 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a44d0aace33f08f3fb0a0eb7bd45a32d8366940e 1 parent 9c33d74
@spookylukey spookylukey authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/contrib/contenttypes/generic.py
View
4 django/contrib/contenttypes/generic.py
@@ -59,7 +59,7 @@ def get_content_type(self, obj=None, id=None):
def __get__(self, instance, instance_type=None):
if instance is None:
- raise AttributeError, u"%s must be accessed via instance" % self.name
+ return self
try:
return getattr(instance, self.cache_attr)
@@ -183,7 +183,7 @@ def __init__(self, field):
def __get__(self, instance, instance_type=None):
if instance is None:
- raise AttributeError, "Manager must be accessed via instance"
+ return self
# This import is done here to avoid circular import importing this module
from django.contrib.contenttypes.models import ContentType
Please sign in to comment.
Something went wrong with that request. Please try again.