Compare commits

..

No commits in common. "7cb6dd66c3c0a7b471288f150afe3b1075d3eba9" and "a1e5c3afabaa27b70ab1c957a758ab0c8b19c11f" have entirely different histories.

2 changed files with 8 additions and 40 deletions

View File

@ -474,11 +474,6 @@ class FormSemestreEtape(db.Model):
# etape_apo aurait du etre not null, mais oublié
etape_apo = db.Column(db.String(APO_CODE_STR_LEN), index=True)
def __init__(self, id, formsemestre_id, etape_apo):
self.id = id
self.formsemestre_id = formsemestre_id
self.etape_apo = etape_apo
def __bool__(self):
"Etape False if code empty"
return self.etape_apo is not None and (len(self.etape_apo) > 0)

View File

@ -38,7 +38,7 @@ from app.models import (
NotesNotes,
ApcReferentielCompetences,
ApcCompetence,
Absence, FormSemestreEtape,
Absence,
)
from app import db
from app.models.but_refcomp import (
@ -180,31 +180,13 @@ def create_formsemestre(
def inscrit_etudiants(etuds: list, formsemestre: FormSemestre):
"""Inscrit les etudiants aux semestres et à tous ses modules"""
for etud in etuds:
aleatoire = random.randint(0, 10)
if aleatoire <= 3:
sco_formsemestre_inscriptions.do_formsemestre_inscription_with_modules(
formsemestre.id,
etud.id,
group_ids=[],
etat="I",
method="init db test",
)
elif 3 < aleatoire <= 6:
sco_formsemestre_inscriptions.do_formsemestre_inscription_with_modules(
formsemestre.id,
etud.id,
group_ids=[],
etat="D",
method="init db test",
)
else:
sco_formsemestre_inscriptions.do_formsemestre_inscription_with_modules(
formsemestre.id,
etud.id,
group_ids=[],
etat="DEF",
method="init db test",
)
sco_formsemestre_inscriptions.do_formsemestre_inscription_with_modules(
formsemestre.id,
etud.id,
group_ids=[],
etat="I",
method="init db test",
)
def create_evaluations(formsemestre: FormSemestre):
@ -482,14 +464,6 @@ def add_absences(formsemestre: FormSemestre):
id_db += 1
def create_etape_apo(formsemestre: FormSemestre):
"""
Ajoute étape apoge au formsemestre
"""
etape_apo = FormSemestreEtape(id=1, formsemestre_id=formsemestre.id, etape_apo="A1")
formsemestre.etapes = etape_apo
def init_test_database():
"""Appelé par la commande `flask init-test-database`
@ -506,7 +480,6 @@ def init_test_database():
saisie_notes_evaluations(formsemestre, user_lecteur)
create_ref_comp(formation)
add_absences(formsemestre)
create_etape_apo(formsemestre)
# à compléter
# - groupes
# - absences