From cbe85dfb7d4d920eadf8bcc84de35507e755d843 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 12 Apr 2024 01:04:27 +0200 Subject: [PATCH] anonymize_users: ignore admin --- tools/anonymize_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/anonymize_db.py b/tools/anonymize_db.py index 110e87db5..494c61a00 100755 --- a/tools/anonymize_db.py +++ b/tools/anonymize_db.py @@ -157,7 +157,7 @@ def anonymize_users(cursor): cursor.execute("""UPDATE "user" SET token = NULL;""") cursor.execute("""UPDATE "user" SET token_expiration = NULL;""") # Change les noms/prenoms/mail - cursor.execute("""SELECT * FROM "user";""") + cursor.execute("""SELECT * FROM "user" WHERE user_name <> 'admin';""") users = cursor.fetchall() # fetch tout car modifie cette table ds la boucle nb_users = len(users) used_user_names = {u["user_name"] for u in users}