Fix anonymizers based on NumericFieldAnonymizer#9
Merged
xkubov merged 1 commit intoskip-pay:masterfrom Feb 27, 2026
Merged
Conversation
3b074d8 to
352d9d6
Compare
get_numeric_encryption_key method could return zero which would cause some of the anonymizers to not perform any anonymization whatsover.
352d9d6 to
f4033e0
Compare
sp-tm
commented
Feb 24, 2026
| python-dateutil==2.7.5 | ||
| django-extensions | ||
| freezegun==0.3.12 | ||
| freezegun |
Author
There was a problem hiding this comment.
The old version doesn't work in Python >= 3.13.
| skip-django-germanium==2.4.0 | ||
| skip-django-germanium==2.6.0 | ||
| django-auditlog | ||
| setuptools |
| 'Programming Language :: Python :: 3.13', | ||
| 'Programming Language :: Python :: 3.14', | ||
| 'Programming Language :: Python :: 3 :: Only', | ||
| 'Intended Audience :: Developers', |
| 'Intended Audience :: Developers', | ||
| 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', | ||
| ], | ||
| python_requires='>=3.10', |
Author
There was a problem hiding this comment.
I'm setting 3.10 as the minimum version because:
- Previous versions have already reached EOL.
- The code was already incompatible with versions < 3.10, e.g. because of declarations like
Type[Model] | Nonewhile not importing from__future__.
HonzaSaibic
approved these changes
Feb 24, 2026
xkubov
approved these changes
Feb 24, 2026
Formulka
approved these changes
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes an issue that
gdpr.anonymizers.base.NumericFieldAnonymizer.get_numeric_encryption_keymight return a zero because the modulo operation used might produce a zero remainder. Most of the children ofNumericFieldAnonymizertake this into account but some didn't and would pass that zero togdpr.anonymizers.local.cs.CzechAccountNumber.brute_force_nextresulting in no operation and therefore silently skipping the anonymization.The following anonymizers were affected:
WARNING: This change causes an incompatibility due to which previously anonymized data cannot be correctly deanonymized. This only affects setups that use reversive anonymization for those fields. As such, the next version should be a major one and declare this incompatibility.