From 078b8be33db8857be8f5da533b7c9a705da9568d Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 5 Apr 2022 14:05:43 +0200 Subject: [PATCH] updated for ScoDoc9 --- tools/fakeportal/demo_reset_noms.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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