help="Anonymize the data in the database in order to use them on critical servers (dev, personnal...). Every information will be overwritten using non-personnal informations. This script must follow any modification of the database."
help="Anonymize the data in the database in order to use them on critical servers (dev, personnal...). Every information will be overwritten using non-personnal informations. This script must follow any modification of the database.\nOptionnal argument: {id|id|id|...} to exclude users from anonymisation"
self.stdout.write(self.style.HTTP_NOT_MODIFIED('The password will be: {}'.format(password)))
u.update(pwd_ntlm=hashNT(password))
u.update(password=makeSecret(password))
self.stdout.write(self.style.SUCCESS('done...'))
self.stdout.write("Data anonymized!")
defhandle(self,*args,**kwargs):
users_ids=kwargs['user_id']
foruser_idinusers_ids:
self.stdout.write("User: {} will not be anonymised".format(User.objects.filter(id=user_id).get().name))
self.stdout.write(self.style.WARNING('\nDISCLAIMER\nThis function will make your database unusable for production. Are you sure you want to run this ?(doit): '))
if(input()=="doit"):
total=Adherent.objects.count()
self.stdout.write("Starting anonymizing the {} users data.".format(total))