Server settings → Data protection: the dry run ignores the retention typed beside its button and reports on the saved one #483
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#483
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, readingDataProtectionView.postand pressing the dry run in a test.Related to #297.
Checked again on 2026-10-01 against
mainat0a5cad587: still present. The code is now atcore/server_views.py:614-624(DataProtectionView.post);core/gdpr.py, the template andtests/test_gdpr.pyhave not changed, and the dry run answers the same.The "Run the dry run" button sits in the Retention card directly under the retention field, in the same form, which reads as "show me what this number would touch". The view never looks at the posted number: the report is drawn from the value already saved, while the re-rendered field keeps showing what was typed.
core/server_views.py:613-623,DataProtectionView.post, which binds the form and then callsgdpr.retention_dry_run()with no argument;core/gdpr.py:317-344, whereretention_dry_run()takes its cutoff fromretention_cutoff()and so fromSiteSettings.get().retention_days; the button is intemplates/server/data_protection.html:19-30.value="365". With 30 saved and 365 typed, the report lists everything older than 30 days; only the "(30 days)" in the report's first line shows that it is not the number on screen.tests/test_gdpr.py:323-341postsretention_days=1with the dry run and passes because the report follows the stored 30, so the suite does not notice the mismatch.retention_dry_run()adaysargument, validate the bound form in the dry-run branch and pass its cleanedretention_dayswhen it is valid and set, falling back to the stored value otherwise, and still save nothing. If the dry run is instead meant to report on the saved policy only, move the button out of the form beside the saved value and say so; either way the report and the field must not disagree.Done when
tests/test_gdpr.pyhas a test that, with nothing stored, postsretention_days=30withdry_runand finds a 45-day-old contact in the report, and findsSiteSettings.get().retention_daysstillNoneafterwards. It fails today.