Browse files

Fix exception message from 3190abc. Refs #18153.

Thanks Preston Holmes.
  • Loading branch information...
aaugustin committed Oct 9, 2012
1 parent 3190abc commit 0a0fe8f71d54e8479e3050ef3bb9d545fd734a65
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/db/models/fields/
@@ -308,7 +308,7 @@ def __set__(self, instance, value):
related_pk = getattr(instance, self.related.field.rel.get_related_field().attname)
if related_pk is None:
raise ValueError('Cannot assign "%r": "%s" instance isn\'t saved in the database.' %
- (value, self.related.opts.object_name))
+ (value, instance._meta.object_name))
# Set the value of the related field to the value of the related object's related field
setattr(value, self.related.field.attname, related_pk)

0 comments on commit 0a0fe8f

Please sign in to comment.