1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

Fixed attribute error in an exception message

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2712 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant 2006-04-17 23:13:48 +00:00
parent ef3c0e06e1
commit 6112223100

View File

@ -116,7 +116,7 @@ class ReverseSingleRelatedObjectDescriptor(object):
def __get__(self, instance, instance_type=None): def __get__(self, instance, instance_type=None):
if instance is None: if instance is None:
raise AttributeError, "%s must be accessed via instance" % self._field.name raise AttributeError, "%s must be accessed via instance" % self.field.name
cache_name = self.field.get_cache_name() cache_name = self.field.get_cache_name()
try: try:
return getattr(instance, cache_name) return getattr(instance, cache_name)