1
0
forked from ScoDoc/ScoDoc

Fix: billets d'absences (POST)

This commit is contained in:
Emmanuel Viennet 2021-09-24 01:07:00 +02:00
parent 92c401f17c
commit 6d1ffb122b
2 changed files with 4 additions and 11 deletions

View File

@ -626,7 +626,6 @@ def add_absence(
jour,
matin,
estjust,
REQUEST,
description=None,
moduleimpl_id=None,
):

View File

@ -1282,7 +1282,7 @@ def listeBillets(REQUEST=None):
)
@bp.route("/deleteBilletAbsence")
@bp.route("/deleteBilletAbsence", methods=["POST", "GET"])
@scodoc
@permission_required(Permission.ScoAbsChange)
@scodoc7func
@ -1308,7 +1308,7 @@ def deleteBilletAbsence(billet_id, REQUEST=None, dialog_confirmed=False):
return flask.redirect("listeBillets?head_message=Billet%20supprimé")
def _ProcessBilletAbsence(billet, estjust, description, REQUEST):
def _ProcessBilletAbsence(billet, estjust, description):
"""Traite un billet: ajoute absence(s) et éventuellement justificatifs,
et change l'état du billet à 1.
NB: actuellement, les heures ne sont utilisées que pour déterminer si matin et/ou après-midi.
@ -1330,7 +1330,6 @@ def _ProcessBilletAbsence(billet, estjust, description, REQUEST):
dates[0],
0,
estjust,
REQUEST,
description=description,
)
n += 1
@ -1342,7 +1341,6 @@ def _ProcessBilletAbsence(billet, estjust, description, REQUEST):
dates[-1],
1,
estjust,
REQUEST,
description=description,
)
n += 1
@ -1354,7 +1352,6 @@ def _ProcessBilletAbsence(billet, estjust, description, REQUEST):
jour,
0,
estjust,
REQUEST,
description=description,
)
sco_abs.add_absence(
@ -1362,7 +1359,6 @@ def _ProcessBilletAbsence(billet, estjust, description, REQUEST):
jour,
1,
estjust,
REQUEST,
description=description,
)
n += 2
@ -1373,7 +1369,7 @@ def _ProcessBilletAbsence(billet, estjust, description, REQUEST):
return n
@bp.route("/ProcessBilletAbsenceForm")
@bp.route("/ProcessBilletAbsenceForm", methods=["POST", "GET"])
@scodoc
@permission_required(Permission.ScoAbsChange)
@scodoc7func
@ -1440,9 +1436,7 @@ def ProcessBilletAbsenceForm(billet_id, REQUEST=None):
elif tf[0] == -1:
return flask.redirect(scu.ScoURL())
else:
n = _ProcessBilletAbsence(
billet, tf[2]["estjust"], tf[2]["description"], REQUEST
)
n = _ProcessBilletAbsence(billet, tf[2]["estjust"], tf[2]["description"])
if tf[2]["estjust"]:
j = "justifiées"
else: