1
0
forked from ScoDoc/ScoDoc

Fix: enregistrement des RCUEs antérieurs

This commit is contained in:
Emmanuel Viennet 2023-07-18 16:41:02 +02:00
parent f414ec1c0d
commit 0573081711
5 changed files with 16 additions and 16 deletions

View File

@ -269,13 +269,7 @@ def validation_rcue_record(etudid: int):
validation.parcours_id = parcours_id
validation.ue1_id = ue1_id
validation.ue2_id = ue2_id
log(f"updating {validation}")
Scolog.logdb(
method="validation_rcue_record",
etudid=etudid,
msg=f"Mise à jour {validation}",
commit=False,
)
operation = "update"
else:
validation = ApcValidationRCUE(
code=code,
@ -286,15 +280,16 @@ def validation_rcue_record(etudid: int):
ue1_id=ue1_id,
ue2_id=ue2_id,
)
log(f"recording {validation}")
Scolog.logdb(
method="validation_rcue_record",
etudid=etudid,
msg=f"Enregistrement {validation}",
commit=False,
)
operation = "record"
db.session.add(validation)
db.session.commit()
Scolog.logdb(
method="validation_rcue_record",
etudid=etudid,
msg=f"Enregistrement {validation}",
commit=True,
)
log(f"{operation} {validation}")
return validation.to_dict()

View File

@ -82,6 +82,10 @@ class ApcValidationRCUE(db.Model):
"as a dict"
d = dict(self.__dict__)
d.pop("_sa_instance_state", None)
d["etud"] = self.etud.to_dict_short()
d["ue1"] = self.ue1.to_dict()
d["ue2"] = self.ue2.to_dict()
return d
def to_dict_bul(self) -> dict:

View File

@ -517,7 +517,7 @@ def ficheEtud(etudid=None):
cursus=but_cursus,
scu=scu,
)}
<div>
<div class="link_validation_rcues">
<a href="{url_for("notes.validation_rcues",
scodoc_dept=g.scodoc_dept, etudid=etudid,
formsemestre_id=last_formsemestre.id)}"

View File

@ -100,6 +100,7 @@
data-ue2_id="{{niv['ue_pair'].id}}"
data-code="{{validation.code if validation else ''}}"
>
<option value="" disabled {{"selected" if not validation else ""}}>-</option>
{% for code in rcue_codes %}
<option value="{{code}}"
{% if validation and validation.code == code -%}

View File

@ -1,7 +1,7 @@
# -*- mode: python -*-
# -*- coding: utf-8 -*-
SCOVERSION = "9.5.5"
SCOVERSION = "9.5.6"
SCONAME = "ScoDoc"