Commit 0a0fe8f7 authored by Aymeric Augustin's avatar Aymeric Augustin
Browse files

Fix exception message from 3190abcd. Refs #18153.

Thanks Preston Holmes.
parent 3190abcd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -308,7 +308,7 @@ class SingleRelatedObjectDescriptor(object):
        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)