Skip to content

Vie privée : anonymiser les professionnels non actifs depuis plus de deux ans#6366

Merged
vincentporte merged 5 commits into
masterfrom
vp/GEN-2421_anonymize_inactive_pros
Jul 1, 2025
Merged

Vie privée : anonymiser les professionnels non actifs depuis plus de deux ans#6366
vincentporte merged 5 commits into
masterfrom
vp/GEN-2421_anonymize_inactive_pros

Conversation

@vincentporte

@vincentporte vincentporte commented Jun 17, 2025

Copy link
Copy Markdown

reprise de #6074 suite au split de la management commande dans #6332

prerequis #6370 (ajout & modification des modèles) et #6371 (déclaration de la management command)

🤔 Pourquoi ?

Anonymiser les comptes de prescripteurs, d'employeurs et d'inspecteurs du travail, inactifs depuis 24 mois

Si le compte n'est lié à aucun objet protégé ou restreint, l'utilisater est supprimé, un AnonymizedProfessionnal est enregistré à la place.

Si le compte est lié à des objets protégés ou restreints, l'utilisateur est conservé, les données personnelles sont effacées sauf le nom et le prénom. L'utilisateur et ses memberships sont passés à l'état is_active=False. Son password est rendu inutilisable

🍰 Comment ?

Décrivez en quelques mots la solution retenue et mise en oeuvre, les difficultés ou problèmes rencontrés. Attirez l'attention sur les décisions d'architecture ou de conception importantes.

🎲 A noter

Les tests de la classe TestRelatedObjectsConsistency permettent de s'assurer que la liste des relations avec le modèle User n'évolue pas sans rappeler le besoin de mettre à jour, éventuellement, les commandes de notification et d'archivage

@vincentporte vincentporte self-assigned this Jun 17, 2025
@notion-workspace

Copy link
Copy Markdown

@vincentporte vincentporte added the ajouté Ajouté dans le changelog. label Jun 17, 2025
@vincentporte vincentporte force-pushed the vp/GEN-2421_anonymize_inactive_pros branch 4 times, most recently from 161de9e to 807a250 Compare June 18, 2025 06:33
@vincentporte vincentporte changed the base branch from master to vp/GEN-2421_anonymize_pros_update_models June 18, 2025 06:39
@vincentporte vincentporte changed the base branch from vp/GEN-2421_anonymize_pros_update_models to vp/GEN-2421_reset_notified_professionals June 18, 2025 06:47
@vincentporte vincentporte force-pushed the vp/GEN-2421_anonymize_inactive_pros branch from 807a250 to 17be1a3 Compare June 18, 2025 06:52
Comment thread itou/archive/utils.py Outdated
@xavfernandez

Copy link
Copy Markdown
Contributor

Ça me semble très bien 👍

Comment thread itou/archive/management/commands/anonymize_professionals.py Outdated
Comment thread itou/archive/management/commands/anonymize_professionals.py Outdated
@vincentporte vincentporte force-pushed the vp/GEN-2421_reset_notified_professionals branch from 5d4dad3 to 9bcf1cc Compare June 18, 2025 08:55
@vincentporte vincentporte force-pushed the vp/GEN-2421_anonymize_inactive_pros branch from 17be1a3 to 12a53e2 Compare June 18, 2025 08:55
@vincentporte vincentporte force-pushed the vp/GEN-2421_reset_notified_professionals branch from 9bcf1cc to 25a2beb Compare June 18, 2025 10:02
@vincentporte vincentporte force-pushed the vp/GEN-2421_anonymize_inactive_pros branch from 12a53e2 to 5535a9b Compare June 18, 2025 12:26
@vincentporte vincentporte force-pushed the vp/GEN-2421_reset_notified_professionals branch from 25a2beb to 0c88ea8 Compare June 18, 2025 13:17
@vincentporte vincentporte force-pushed the vp/GEN-2421_anonymize_inactive_pros branch from 5535a9b to b5af8af Compare June 18, 2025 13:17
@vincentporte vincentporte force-pushed the vp/GEN-2421_reset_notified_professionals branch from 0c88ea8 to 5db364f Compare June 18, 2025 13:23
@vincentporte vincentporte force-pushed the vp/GEN-2421_anonymize_inactive_pros branch from b5af8af to c13e297 Compare June 18, 2025 13:23
Comment thread itou/archive/management/commands/anonymize_professionals.py Outdated
@vincentporte vincentporte force-pushed the vp/GEN-2421_anonymize_inactive_pros branch from c13e297 to 6b0d070 Compare June 18, 2025 16:54
@vincentporte vincentporte force-pushed the vp/GEN-2421_reset_notified_professionals branch from 5db364f to 7049e2d Compare June 19, 2025 07:18
@vincentporte vincentporte force-pushed the vp/GEN-2421_anonymize_inactive_pros branch from 6b0d070 to ead635a Compare June 19, 2025 08:11
@vincentporte vincentporte force-pushed the vp/GEN-2421_reset_notified_professionals branch from 7049e2d to 72e189a Compare June 19, 2025 12:04
@vincentporte vincentporte force-pushed the vp/GEN-2421_anonymize_inactive_pros branch 3 times, most recently from 80b0145 to d1d5ad7 Compare June 19, 2025 13:28
@vincentporte vincentporte marked this pull request as ready for review June 19, 2025 13:28
Comment thread itou/archive/utils.py Outdated
Comment thread tests/archive/tests_utils.py Outdated
@vincentporte vincentporte force-pushed the vp/GEN-2421_reset_notified_professionals branch from 72e189a to 01158a8 Compare June 30, 2025 08:30
@vincentporte vincentporte force-pushed the vp/GEN-2421_anonymize_inactive_pros branch from d1d5ad7 to 9b1b79d Compare June 30, 2025 08:46
Base automatically changed from vp/GEN-2421_reset_notified_professionals to master June 30, 2025 09:30
@vincentporte vincentporte force-pushed the vp/GEN-2421_anonymize_inactive_pros branch 2 times, most recently from 46b68ac to ee1c8f0 Compare June 30, 2025 11:54
Comment thread tests/archive/tests_utils.py
Comment thread itou/archive/management/commands/anonymize_professionals.py Outdated
Comment thread itou/archive/management/commands/anonymize_professionals.py
Comment thread tests/archive/tests_management_command.py Outdated
@vincentporte vincentporte force-pushed the vp/GEN-2421_anonymize_inactive_pros branch 3 times, most recently from 2f5890c to caa0753 Compare June 30, 2025 15:56
@vincentporte vincentporte force-pushed the vp/GEN-2421_anonymize_inactive_pros branch 2 times, most recently from d6d162a to 7b24a36 Compare July 1, 2025 08:04
Comment thread itou/archive/management/commands/anonymize_professionals.py Outdated
Comment thread tests/archive/tests_management_command.py Outdated
Comment thread tests/archive/tests_management_command.py
Comment thread tests/archive/tests_management_command.py Outdated
vincent porte added 3 commits July 1, 2025 21:35
…elated objects of User model

1. These related object are not deleted on cascade, anonymization will be different if some of them exist or not,
2. We use it to alert tech-of-the-future to check archive management command when adding new related object is added to User model
prepare reuse in anonymize_professionals command
@vincentporte vincentporte force-pushed the vp/GEN-2421_anonymize_inactive_pros branch from 7b24a36 to a882fc6 Compare July 1, 2025 20:04
vincent porte added 2 commits July 1, 2025 22:06
delete user and store anonymous datas in AnonymizedProfessional, or anonymize user data until no restricted nor
protected related object remains link to the user.
remove snapshot in benefit of readable expected_message
@vincentporte vincentporte force-pushed the vp/GEN-2421_anonymize_inactive_pros branch from a882fc6 to 09e2956 Compare July 1, 2025 20:12
@vincentporte vincentporte added this pull request to the merge queue Jul 1, 2025
Merged via the queue into master with commit e6fb873 Jul 1, 2025
14 checks passed
@vincentporte vincentporte deleted the vp/GEN-2421_anonymize_inactive_pros branch July 1, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ajouté Ajouté dans le changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants