Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix exception message from 3190abc. Refs #18153.

Thanks Preston Holmes.
  • Loading branch information...
commit 0a0fe8f71d54e8479e3050ef3bb9d545fd734a65 1 parent 3190abc
@aaugustin aaugustin authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/db/models/fields/related.py
View
2  django/db/models/fields/related.py
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.