Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
2 changed files with 6 additions and 2 deletions
Showing only changes of commit 0fbcfb1124 - Show all commits

View File

@ -5,7 +5,7 @@ Gestion des listes d'assiduités et justificatifs
from datetime import datetime from datetime import datetime
from flask import url_for from flask import url_for, request
from flask_login import current_user from flask_login import current_user
from flask_sqlalchemy.query import Query from flask_sqlalchemy.query import Query
from sqlalchemy import desc, literal, union, asc from sqlalchemy import desc, literal, union, asc
@ -606,6 +606,7 @@ class RowAssiJusti(tb.Row):
"assiduites.edit_justificatif_etud", "assiduites.edit_justificatif_etud",
justif_id=self.ligne["obj_id"], justif_id=self.ligne["obj_id"],
scodoc_dept=g.scodoc_dept, scodoc_dept=g.scodoc_dept,
back_url=request.url,
) )
else: else:
url = url_for( url = url_for(

View File

@ -660,11 +660,14 @@ def edit_justificatif_etud(justif_id: int):
) )
form.etat.data = str(justif.etat) form.etat.data = str(justif.etat)
redirect_url = url_for( back_url = request.args.get("back_url", None)
redirect_url = back_url or url_for(
"assiduites.liste_assiduites_etud", "assiduites.liste_assiduites_etud",
scodoc_dept=g.scodoc_dept, scodoc_dept=g.scodoc_dept,
etudid=justif.etudiant.id, etudid=justif.etudiant.id,
) )
if form.validate_on_submit(): if form.validate_on_submit():
if form.cancel.data: # cancel button if form.cancel.data: # cancel button
return redirect(redirect_url) return redirect(redirect_url)