[x] I have verified that that issue exists against the master branch of django-anon
[x] I have searched for similar issues in both open and closed tickets and cannot find a duplicate
[x] I have reduced the issue to the simplest possible case
[x] I have included a failing test as a pull request (If you are unable to do so we can still accept the issue)
Steps to reproduce
Create an anon class without defining fields, as we can see in the README:
import anon
class UserAnonymizer(anon.BaseAnonymizer):
class Meta:
model = User
def clean(self, obj):
obj.set_password('test')
obj.save()
Expected behavior
After running the anonymize the password is set to test.
Actual behavior
Using python3.9 and Django2.2 it raises an exception:
File "/site-packages/anon/base.py", line 89, in run
bulk_update(
File "/site-packages/anon/compat.py", line 19, in bulk_update
manager.bulk_update(objects, fields, **bulk_update_kwargs)
File "/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/site-packages/django/db/models/query.py", line 491, in bulk_update
raise ValueError('Field names must be given to bulk_update().')
ValueError: Field names must be given to bulk_update().
Checklist
master
branch of django-anonSteps to reproduce
Create an anon class without defining fields, as we can see in the README:
Expected behavior
After running the anonymize the password is set to
test
.Actual behavior
Using python3.9 and Django2.2 it raises an exception: