From f4bc1b140c772505ea46c304a45ed69295a3b187 Mon Sep 17 00:00:00 2001 From: klmp200 Date: Sun, 17 Sep 2017 18:09:16 +0200 Subject: [PATCH] Fix is_active migration --- migrate.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/migrate.py b/migrate.py index 3a2fbe33..cf424b51 100644 --- a/migrate.py +++ b/migrate.py @@ -1379,10 +1379,13 @@ def migrate_club_again(): cur = db.cursor(MySQLdb.cursors.SSDictCursor) cur.execute("SELECT * FROM asso") + print("Migrating club is_active") + for club in cur: try: - c = Club.objects.get(id=club['id_asso']) - c.is_disabled = club['hidden'] == 1 + c = Club.objects.get(unix_name=club['nom_unix_asso']) + c.is_active = club['hidden'] == 0 + c.save() except: pass