From cbd85ff0eb32ed59af3b90c6ba30e235e2d3db70 Mon Sep 17 00:00:00 2001 From: Grizzly Date: Wed, 9 Jan 2019 18:14:06 +0000 Subject: [PATCH] Suppression de l'historique --- users/management/commands/anonymize.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/users/management/commands/anonymize.py b/users/management/commands/anonymize.py index e057cf24..a6bce971 100644 --- a/users/management/commands/anonymize.py +++ b/users/management/commands/anonymize.py @@ -1,6 +1,7 @@ from django.core.management.base import BaseCommand from users.models import User, School, Adherent, Club from machines.models import Domain, Machine +from reversion.models import Revision from django.db.models import F, Value from django.db.models import Q from django.db.models.functions import Concat @@ -87,6 +88,10 @@ class Command(BaseCommand): u.update(password = makeSecret(password)) self.stdout.write(self.style.SUCCESS('done...')) + self.stdout.write('Suppression de l\'historique (This may take some time)') + Revision.objects.all().delete() + self.stdout.write(self.style.SUCCESS('done...')) + self.stdout.write("Data anonymized!") else: