Skip to content

Commit

Permalink
Increase profile data minimisation retention period (#3485)
Browse files Browse the repository at this point in the history
* Change the time after which the profiles of ex-members are minimised from 1 to 3 months (93 days).

* Use 90 instead of 93 days

I figured 93 is a bit random as no 3 months actually are 93 days together. 3*30 is more appropriate.

* Update privacy policy

* Bump privacy policy version (assuming 2023-12-14)

* Update tests

---------

Co-authored-by: Dirk Doesburg <[email protected]>
  • Loading branch information
tvanonna and DeD1rk authored Dec 13, 2023
1 parent 21605ef commit d104387
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 227 deletions.
2 changes: 1 addition & 1 deletion website/members/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def execute_data_minimisation(dry_run=False, members=None) -> list[Member]:
.distinct()
.prefetch_related("membership_set", "profile")
)
deletion_period = timezone.now().date() - timezone.timedelta(days=31)
deletion_period = timezone.now().date() - timezone.timedelta(days=90)
processed_members = []
for member in members:
if (
Expand Down
6 changes: 3 additions & 3 deletions website/members/tests/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_process_email_change(self, send_message_mock):
send_message_mock.assert_called_once_with(change_request)


@freeze_time("2018-10-2")
@freeze_time("2018-12-2")
@override_settings(SUSPEND_SIGNALS=True)
class DataMinimisationTest(TestCase):
@classmethod
Expand Down Expand Up @@ -114,12 +114,12 @@ def setUpTestData(cls):
)

def test_removes_after_31_days_or_no_membership(self):
with self.subTest("Deletes after 31 days"):
with self.subTest("Deletes after 90 days"):
processed = services.execute_data_minimisation(True)
self.assertEqual(len(processed), 2)
self.assertEqual(processed[0], self.m1)

with self.subTest("Deletes after 31 days"):
with self.subTest("Deletes after 90 days"):
self.s1.until = timezone.now().replace(year=2018, month=11, day=1)
self.s1.save()
processed = services.execute_data_minimisation(True)
Expand Down
Loading

0 comments on commit d104387

Please sign in to comment.