updated for ScoDoc9

This commit is contained in:
Emmanuel Viennet 2022-04-05 14:05:43 +02:00
parent 592a2a33c5
commit 078b8be33d

View File

@ -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