Ticket #12888: patch-12888.diff

File patch-12888.diff, 2.1 KB (added by nessita, 5 years ago)

Submitting trivial patch.

  • django/db/models/fields/related.py

     
    227227                value._state.db = router.db_for_write(value.__class__, instance=instance)
    228228            elif value._state.db is not None and instance._state.db is not None:
    229229                if not router.allow_relation(value, instance):
    230                     raise ValueError('Cannot assign "%r": instance is on database "%s", value is is on database "%s"' %
     230                    raise ValueError('Cannot assign "%r": instance is on database "%s", value is on database "%s"' %
    231231                                        (value, instance._state.db, value._state.db))
    232232
    233233        # Set the value of the related field to the value of the related object's related field
     
    299299                value._state.db = router.db_for_write(value.__class__, instance=instance)
    300300            elif value._state.db is not None and instance._state.db is not None:
    301301                if not router.allow_relation(value, instance):
    302                     raise ValueError('Cannot assign "%r": instance is on database "%s", value is is on database "%s"' %
     302                    raise ValueError('Cannot assign "%r": instance is on database "%s", value is on database "%s"' %
    303303                                        (value, instance._state.db, value._state.db))
    304304
    305305        # If we're setting the value of a OneToOneField to None, we need to clear
     
    521521                for obj in objs:
    522522                    if isinstance(obj, self.model):
    523523                        if not router.allow_relation(obj, self.instance):
    524                            raise ValueError('Cannot add "%r": instance is on database "%s", value is is on database "%s"' %
     524                           raise ValueError('Cannot add "%r": instance is on database "%s", value is on database "%s"' %
    525525                                               (obj, self.instance._state.db, obj._state.db))
    526526                        new_ids.add(obj.pk)
    527527                    elif isinstance(obj, Model):
Back to Top