summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/db/models/fields/related.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py
index fbb40d9175..a16f9553c6 100644
--- a/django/db/models/fields/related.py
+++ b/django/db/models/fields/related.py
@@ -364,7 +364,7 @@ class ReverseSingleRelatedObjectDescriptor(object):
def __set__(self, instance, value):
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)
# If null=True, we can assign null here, but otherwise the value needs
# to be an instance of the related class.