From d099bb1c4da6bc734201799b0282d9ff2d984d91 Mon Sep 17 00:00:00 2001 From: Dmytro Vdovychynskyi Date: Thu, 24 Mar 2022 15:02:05 +0200 Subject: [PATCH] fix issue when model manager is overridden (#71) * fix issue when model manager is overridden --- dj_anonymizer/anonymizer.py | 2 +- docs/changelog.rst | 4 ++++ docs/conf.py | 2 +- setup.py | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dj_anonymizer/anonymizer.py b/dj_anonymizer/anonymizer.py index 2de85dc..c3eb678 100644 --- a/dj_anonymizer/anonymizer.py +++ b/dj_anonymizer/anonymizer.py @@ -74,7 +74,7 @@ def anonymize(self, only=None): setattr(obj, name, next( getattr(anonym_cls, name)) ) - subset.model.objects.bulk_update( + queryset.bulk_update( subset, anonym_cls.get_fields_names(), batch_size=settings.ANONYMIZER_UPDATE_BATCH_SIZE, diff --git a/docs/changelog.rst b/docs/changelog.rst index cf2118c..2b12326 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,10 @@ Changelog ============= +UNRELEASED +---------- +* Bugfix: fix issue when model manager is overridden (`#71 `__) + 0.5.0 ---------- * Feature: add possibility to execute anonymizer only on the specified model (`#69 `__) diff --git a/docs/conf.py b/docs/conf.py index 50bd424..1c6a1f2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,7 +26,7 @@ # The short X.Y version version = '' # The full version, including alpha/beta/rc tags -release = '0.5.0' +release = '0.5.1-beta1' # -- General configuration --------------------------------------------------- diff --git a/setup.py b/setup.py index bcb12db..56723b4 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ def read(*rnames): name='dj_anonymizer', packages=['dj_anonymizer'], include_package_data=True, - version='0.5.0', + version='0.5.1-beta1', description='This project helps anonymize production database ' + 'with fake data of any kind.', long_description=(read('README.md')),