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

BaseModelAnonymiser crashes on TextField #3

Open
jhonatan-lopes opened this issue Nov 29, 2024 · 0 comments · May be fixed by #4
Open

BaseModelAnonymiser crashes on TextField #3

jhonatan-lopes opened this issue Nov 29, 2024 · 0 comments · May be fixed by #4

Comments

@jhonatan-lopes
Copy link

When trying to anonymise TextFields, the anonymiser crashes with:

 File "/app/.venv/lib/python3.10/site-packages/birdbath/management/commands/run_birdbath.py", line 49, in handle
    raise Exception(errors)
Exception: [TypeError("unsupported operand type(s) for +: 'NoneType' and 'int'")]

Reproducing

Create a new model with a TextField and an anonymiser targeting it:

from django.db import models
from birdbath.processors import BaseModelAnonymiser

class MyModel(models.Model):
    text_field = models.TextField()


class MyAnonymiser(BaseModelAnonymiser):
    model = MyModel
    anonymise_fields = ["text_field"]

And then run ./manage.py run_birdbath to see the error.

@jhonatan-lopes jhonatan-lopes linked a pull request Nov 29, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant