Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging deletion of models with deferred fields on default queryset fails (v2.3.0, v3.0.0) #694

Open
michael-sayapin opened this issue Jan 21, 2025 · 0 comments

Comments

@michael-sayapin
Copy link

With a model defined like this:

class DeferBinaryContentsManager(models.Manager):
    def get_queryset(self):
        return super().get_queryset().defer("binary_contents")

class FileUpload(models.Model):
    objects = DeferBinaryContentsManager()
    ...
    binary_contents = models.BinaryField(editable=True)

...log_delete method fails in _get_copy_with_python_typed_fields where value = getattr(instance_copy, field.name) calls an implicit refresh_from_db. Unfortunately, "exclude_fields": ["binary_contents"] in AUDITLOG_INCLUDE_TRACKING_MODELS does not help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant