mirror of
https://gitlab.crans.org/bde/nk20-scripts
synced 2025-06-29 01:40:55 +02:00
Anonymize data, fix remittancei import
This commit is contained in:
21
management/commands/anonymize_data.py
Normal file
21
management/commands/anonymize_data.py
Normal file
@ -0,0 +1,21 @@
|
||||
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.db import connection
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""
|
||||
Command to protect sensitive data during the beta phase, to prevent a right escalation.
|
||||
Phone number, email address, postal address, first and last name are removed.
|
||||
"""
|
||||
def handle(self, *args, **kwargs):
|
||||
cur = connection.cursor()
|
||||
cur.execute("UPDATE member_profile SET "
|
||||
"phone_number = '0123456789', "
|
||||
"address = '4 avenue des Sciences, 91190 GIF-SUR-YVETTE';")
|
||||
cur.execute("UPDATE auth_user SET "
|
||||
"first_name = 'Anne', "
|
||||
"last_name = 'Onyme';")
|
||||
cur.close()
|
Reference in New Issue
Block a user