Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCODOC_R6A06
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Paul Milleville
SCODOC_R6A06
Commits
f9b50bb2
Commit
f9b50bb2
authored
3 years ago
by
Emmanuel Viennet
Browse files
Options
Downloads
Patches
Plain Diff
Jury BUT: génération des autorisations d'inscription
parent
d364d301
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/but/jury_but.py
+33
-9
33 additions, 9 deletions
app/but/jury_but.py
app/models/validations.py
+40
-1
40 additions, 1 deletion
app/models/validations.py
app/scodoc/sco_codes_parcours.py
+6
-0
6 additions, 0 deletions
app/scodoc/sco_codes_parcours.py
with
79 additions
and
10 deletions
app/but/jury_but.py
+
33
−
9
View file @
f9b50bb2
...
@@ -67,6 +67,7 @@ from app import db
...
@@ -67,6 +67,7 @@ from app import db
from
app
import
log
from
app
import
log
from
app.comp.res_but
import
ResultatsSemestreBUT
from
app.comp.res_but
import
ResultatsSemestreBUT
from
app.comp
import
res_sem
from
app.comp
import
res_sem
from
app.models
import
formsemestre
from
app.models.but_refcomp
import
(
from
app.models.but_refcomp
import
(
ApcAnneeParcours
,
ApcAnneeParcours
,
...
@@ -75,7 +76,7 @@ from app.models.but_refcomp import (
...
@@ -75,7 +76,7 @@ from app.models.but_refcomp import (
ApcParcours
,
ApcParcours
,
ApcParcoursNiveauCompetence
,
ApcParcoursNiveauCompetence
,
)
)
from
app.models
import
Scolog
from
app.models
import
Scolog
,
ScolarAutorisationInscription
from
app.models.but_validations
import
(
from
app.models.but_validations
import
(
ApcValidationAnnee
,
ApcValidationAnnee
,
ApcValidationRCUE
,
ApcValidationRCUE
,
...
@@ -87,7 +88,7 @@ from app.models.formsemestre import FormSemestre, FormSemestreInscription
...
@@ -87,7 +88,7 @@ from app.models.formsemestre import FormSemestre, FormSemestreInscription
from
app.models.ues
import
UniteEns
from
app.models.ues
import
UniteEns
from
app.models.validations
import
ScolarFormSemestreValidation
from
app.models.validations
import
ScolarFormSemestreValidation
from
app.scodoc
import
sco_codes_parcours
as
sco_codes
from
app.scodoc
import
sco_codes_parcours
as
sco_codes
from
app.scodoc.sco_codes_parcours
import
UE_STANDARD
from
app.scodoc.sco_codes_parcours
import
RED
,
UE_STANDARD
from
app.scodoc
import
sco_utils
as
scu
from
app.scodoc
import
sco_utils
as
scu
from
app.scodoc.sco_exceptions
import
ScoException
,
ScoValueError
from
app.scodoc.sco_exceptions
import
ScoException
,
ScoValueError
...
@@ -457,13 +458,19 @@ class DecisionsProposeesAnnee(DecisionsProposees):
...
@@ -457,13 +458,19 @@ class DecisionsProposeesAnnee(DecisionsProposees):
d
[
dec_rcue
.
rcue
.
ue_2
.
id
]
=
dec_rcue
d
[
dec_rcue
.
rcue
.
ue_2
.
id
]
=
dec_rcue
return
d
return
d
# def lookup_ue(self, ue_id: int) -> UniteEns:
def
next_annee_semestre_id
(
self
,
code
:
str
)
->
int
:
# "check that ue_id belongs to our UE, if not returns None"
"""
L
'
indice du semestre dans lequel l
'
étudiant est autorisé à
# ues = [ue for ue in self.ues_impair + self.ues_pair if ue.id == ue_id]
poursuivre l
'
année suivante. None si aucun.
"""
# assert len(ues) < 2
if
self
.
formsemestre_pair
is
None
:
# if len(ues):
return
None
# seulement sur année
# return ues[0]
if
code
==
RED
:
# return None
return
self
.
formsemestre_pair
.
semestre_id
-
1
elif
(
code
in
sco_codes
.
BUT_CODES_PASSAGE
and
self
.
formsemestre_pair
.
semestre_id
<
sco_codes
.
ParcoursBUT
.
NB_SEM
):
return
self
.
formsemestre_pair
.
semestre_id
+
1
return
None
def
record_form
(
self
,
form
:
dict
):
def
record_form
(
self
,
form
:
dict
):
"""
Enregistre les codes de jury en base
"""
Enregistre les codes de jury en base
...
@@ -529,6 +536,23 @@ class DecisionsProposeesAnnee(DecisionsProposees):
...
@@ -529,6 +536,23 @@ class DecisionsProposeesAnnee(DecisionsProposees):
msg
=
f
"
Validation année BUT
{
self
.
annee_but
}
:
{
code
}
"
,
msg
=
f
"
Validation année BUT
{
self
.
annee_but
}
:
{
code
}
"
,
)
)
db
.
session
.
add
(
self
.
validation
)
db
.
session
.
add
(
self
.
validation
)
# --- Autorisation d'inscription dans semestre suivant ?
if
self
.
formsemestre_pair
is
not
None
:
if
code
is
None
:
ScolarAutorisationInscription
.
delete_autorisation_etud
(
etudid
=
self
.
etud
.
id
,
origin_formsemestre_id
=
self
.
formsemestre_pair
.
id
,
)
else
:
next_semestre_id
=
self
.
next_annee_semestre_id
(
code
)
if
next_semestre_id
is
not
None
:
ScolarAutorisationInscription
.
autorise_etud
(
self
.
etud
.
id
,
self
.
formsemestre_pair
.
formation
.
formation_code
,
self
.
formsemestre_pair
.
id
,
next_semestre_id
,
)
self
.
recorded
=
True
self
.
recorded
=
True
def
record_all
(
self
):
def
record_all
(
self
):
...
...
This diff is collapsed.
Click to expand it.
app/models/validations.py
+
40
−
1
View file @
f9b50bb2
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
from
app
import
db
from
app
import
db
from
app.models
import
SHORT_STR_LEN
from
app.models
import
SHORT_STR_LEN
from
app.models
import
CODE_STR_LEN
from
app.models
import
CODE_STR_LEN
from
app.models.events
import
Scolog
class
ScolarFormSemestreValidation
(
db
.
Model
):
class
ScolarFormSemestreValidation
(
db
.
Model
):
...
@@ -69,7 +70,7 @@ class ScolarAutorisationInscription(db.Model):
...
@@ -69,7 +70,7 @@ class ScolarAutorisationInscription(db.Model):
db
.
ForeignKey
(
"
identite.id
"
,
ondelete
=
"
CASCADE
"
),
db
.
ForeignKey
(
"
identite.id
"
,
ondelete
=
"
CASCADE
"
),
)
)
formation_code
=
db
.
Column
(
db
.
String
(
SHORT_STR_LEN
),
nullable
=
False
)
formation_code
=
db
.
Column
(
db
.
String
(
SHORT_STR_LEN
),
nullable
=
False
)
# semestre o
u
on peut s'inscrire:
#
Indice du
semestre o
ù
on peut s'inscrire:
semestre_id
=
db
.
Column
(
db
.
Integer
)
semestre_id
=
db
.
Column
(
db
.
Integer
)
date
=
db
.
Column
(
db
.
DateTime
(
timezone
=
True
),
server_default
=
db
.
func
.
now
())
date
=
db
.
Column
(
db
.
DateTime
(
timezone
=
True
),
server_default
=
db
.
func
.
now
())
origin_formsemestre_id
=
db
.
Column
(
origin_formsemestre_id
=
db
.
Column
(
...
@@ -77,6 +78,44 @@ class ScolarAutorisationInscription(db.Model):
...
@@ -77,6 +78,44 @@ class ScolarAutorisationInscription(db.Model):
db
.
ForeignKey
(
"
notes_formsemestre.id
"
),
db
.
ForeignKey
(
"
notes_formsemestre.id
"
),
)
)
@classmethod
def
autorise_etud
(
cls
,
etudid
:
int
,
formation_code
:
str
,
origin_formsemestre_id
:
int
,
semestre_id
:
int
,
):
"""
Enregistre une autorisation, remplace celle émanant du même semestre si elle existe.
"""
cls
.
delete_autorisation_etud
(
etudid
,
origin_formsemestre_id
)
autorisation
=
cls
(
etudid
=
etudid
,
formation_code
=
formation_code
,
origin_formsemestre_id
=
origin_formsemestre_id
,
semestre_id
=
semestre_id
,
)
db
.
session
.
add
(
autorisation
)
Scolog
.
logdb
(
"
autorise_etud
"
,
etudid
=
etudid
,
msg
=
f
"
passage vers S
{
semestre_id
}
"
)
@classmethod
def
delete_autorisation_etud
(
cls
,
etudid
:
int
,
origin_formsemestre_id
:
int
,
):
"""
Efface les autorisations de cette étudiant venant du sem. origine
"""
autorisations
=
cls
.
query
.
filter_by
(
etudid
=
etudid
,
origin_formsemestre_id
=
origin_formsemestre_id
)
for
autorisation
in
autorisations
:
db
.
session
.
delete
(
autorisation
)
Scolog
.
logdb
(
"
autorise_etud
"
,
etudid
=
etudid
,
msg
=
f
"
annule passage vers S
{
autorisation
.
semestre_id
}
"
,
)
db
.
session
.
flush
()
class
ScolarEvent
(
db
.
Model
):
class
ScolarEvent
(
db
.
Model
):
"""
Evenement dans le parcours scolaire d
'
un étudiant
"""
"""
Evenement dans le parcours scolaire d
'
un étudiant
"""
...
...
This diff is collapsed.
Click to expand it.
app/scodoc/sco_codes_parcours.py
+
6
−
0
View file @
f9b50bb2
...
@@ -196,6 +196,12 @@ CODES_RCUE = {ADM, AJ, CMP}
...
@@ -196,6 +196,12 @@ CODES_RCUE = {ADM, AJ, CMP}
BUT_BARRE_UE8
=
8.0
-
NOTES_TOLERANCE
BUT_BARRE_UE8
=
8.0
-
NOTES_TOLERANCE
BUT_BARRE_UE
=
BUT_BARRE_RCUE
=
10.0
-
NOTES_TOLERANCE
BUT_BARRE_UE
=
BUT_BARRE_RCUE
=
10.0
-
NOTES_TOLERANCE
BUT_RCUE_SUFFISANT
=
8.0
-
NOTES_TOLERANCE
BUT_RCUE_SUFFISANT
=
8.0
-
NOTES_TOLERANCE
BUT_CODES_PASSAGE
=
{
ADM
,
ADJ
,
PASD
,
PAS1NCI
,
}
def
code_semestre_validant
(
code
:
str
)
->
bool
:
def
code_semestre_validant
(
code
:
str
)
->
bool
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment