Skip to content

BaseModelAnonymiser crashes on TextField #3

@jhonatan-lopes

Description

@jhonatan-lopes

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions