1
0
forked from ScoDoc/ScoDoc

Fix: 3 bugs liés aux moduleimpl_id

This commit is contained in:
Emmanuel Viennet 2021-08-21 23:09:08 +02:00
parent 784867d51e
commit 089c3d96b4

View File

@ -749,7 +749,13 @@ def edit_enseignants_form(REQUEST, moduleimpl_id):
if tf[0] == 0:
return header + "\n".join(H) + tf[1] + F + footer
elif tf[0] == -1:
return flask.redirect("moduleimpl_status?moduleimpl_id=" + moduleimpl_id)
return flask.redirect(
url_for(
"notes.moduleimpl_status",
scodoc_dept=g.scodoc_dept,
moduleimpl_id=moduleimpl_id,
)
)
else:
ens_id = User.get_user_id_from_nomplogin(tf[2]["ens_id"])
if not ens_id:
@ -841,21 +847,37 @@ def edit_moduleimpl_resp(REQUEST, moduleimpl_id):
if tf[0] == 0:
return "\n".join(H) + tf[1] + help_str + html_sco_header.sco_footer()
elif tf[0] == -1:
return flask.redirect("moduleimpl_status?moduleimpl_id=" + moduleimpl_id)
return flask.redirect(
url_for(
"notes.moduleimpl_status",
scodoc_dept=g.scodoc_dept,
moduleimpl_id=moduleimpl_id,
)
)
else:
responsable_id = User.get_user_id_from_nomplogin(tf[2]["responsable_id"])
if (
not responsable_id
): # presque impossible: tf verifie les valeurs (mais qui peuvent changer entre temps)
return flask.redirect("moduleimpl_status?moduleimpl_id=" + moduleimpl_id)
return flask.redirect(
url_for(
"notes.moduleimpl_status",
scodoc_dept=g.scodoc_dept,
moduleimpl_id=moduleimpl_id,
)
)
sco_moduleimpl.do_moduleimpl_edit(
{"moduleimpl_id": moduleimpl_id, "responsable_id": responsable_id},
formsemestre_id=sem["formsemestre_id"],
)
return flask.redirect(
"moduleimpl_status?moduleimpl_id="
+ moduleimpl_id
+ "&head_message=responsable%20modifié"
url_for(
"notes.moduleimpl_status",
scodoc_dept=g.scodoc_dept,
moduleimpl_id=moduleimpl_id,
head_message="responsable%20modifié",
)
)
@ -929,7 +951,13 @@ def edit_moduleimpl_expr(REQUEST, moduleimpl_id):
if tf[0] == 0:
return "\n".join(H) + tf[1] + html_sco_header.sco_footer()
elif tf[0] == -1:
return flask.redirect("moduleimpl_status?moduleimpl_id=" + moduleimpl_id)
return flask.redirect(
url_for(
"notes.moduleimpl_status",
scodoc_dept=g.scodoc_dept,
moduleimpl_id=moduleimpl_id,
)
)
else:
sco_moduleimpl.do_moduleimpl_edit(
{
@ -942,9 +970,12 @@ def edit_moduleimpl_expr(REQUEST, moduleimpl_id):
formsemestre_id=sem["formsemestre_id"]
) # > modif regle calcul
return flask.redirect(
"moduleimpl_status?moduleimpl_id="
+ moduleimpl_id
+ "&head_message=règle%20de%20calcul%20modifiée"
url_for(
"notes.moduleimpl_status",
scodoc_dept=g.scodoc_dept,
moduleimpl_id=moduleimpl_id,
head_message="règle%20de%20calcul%20modifiée",
)
)