mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-01 03:48:04 +00:00
Fix is_active migration
This commit is contained in:
parent
12c49b285a
commit
f4bc1b140c
@ -1379,10 +1379,13 @@ def migrate_club_again():
|
|||||||
cur = db.cursor(MySQLdb.cursors.SSDictCursor)
|
cur = db.cursor(MySQLdb.cursors.SSDictCursor)
|
||||||
cur.execute("SELECT * FROM asso")
|
cur.execute("SELECT * FROM asso")
|
||||||
|
|
||||||
|
print("Migrating club is_active")
|
||||||
|
|
||||||
for club in cur:
|
for club in cur:
|
||||||
try:
|
try:
|
||||||
c = Club.objects.get(id=club['id_asso'])
|
c = Club.objects.get(unix_name=club['nom_unix_asso'])
|
||||||
c.is_disabled = club['hidden'] == 1
|
c.is_active = club['hidden'] == 0
|
||||||
|
c.save()
|
||||||
except: pass
|
except: pass
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user