diff --git a/tools/fakeportal/demo_reset_noms.py b/tools/fakeportal/demo_reset_noms.py index d1f00cf35c..db7f9fb2bb 100755 --- a/tools/fakeportal/demo_reset_noms.py +++ b/tools/fakeportal/demo_reset_noms.py @@ -35,7 +35,7 @@ cnx = psycopg2.connect(DBCNXSTRING) cursor = cnx.cursor() cursor.execute( - "select count(*) from notes_formsemestre where formsemestre_id=%(formsemestre_id)s", + "select count(*) from notes_formsemestre where id=%(formsemestre_id)s", {"formsemestre_id": formsemestre_id}, ) nsem = cursor.fetchone()[0] @@ -44,9 +44,9 @@ if nsem != 1: sys.exit(2) cursor.execute( - """select i.etudid + """select i.id from identite i, notes_formsemestre_inscription ins - where i.etudid=ins.etudid and ins.formsemestre_id=%(formsemestre_id)s + where i.id=ins.etudid and ins.formsemestre_id=%(formsemestre_id)s """, {"formsemestre_id": formsemestre_id}, ) @@ -64,7 +64,7 @@ for (etudid,) in cursor: "etudid": etudid, "code_nip": random.randrange(10000000, 99999999), } - req = "update identite set nom=%(nom)s, prenom=%(prenom)s, civilite=%(civilite)s where etudid=%(etudid)s" + req = "update identite set nom=%(nom)s, prenom=%(prenom)s, civilite=%(civilite)s where id=%(etudid)s" # print( req % args) wcursor.execute(req, args) n += 1