fix error with created objects that were deleted
@@ -146,7 +146,11 @@ class ChangedObject(models.Model):
setattr(instance, field.name, field.to_python(value))
elif field.many_to_one or field.one_to_one:
if is_created_pk(value):
+ try:
obj = self.changeset.get_created_object(field.related_model, value, allow_deleted=True)
+ except field.related_model.DoesNotExist:
+ pass
+ else:
setattr(instance, field.get_cache_name(), obj)
else:
try:
