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
07acadd5
Commit
07acadd5
authored
2 years ago
by
Emmanuel Viennet
Committed by
iziram
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Modifie contrainte sur ApcValidationAnnee (une modif plus sérieuse est nécessaire)
parent
d519760c
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
+1
-1
1 addition, 1 deletion
app/but/jury_but.py
app/models/but_validations.py
+5
-3
5 additions, 3 deletions
app/models/but_validations.py
migrations/versions/829683efddc4_change_apcvalidationannee.py
+44
-0
44 additions, 0 deletions
...ations/versions/829683efddc4_change_apcvalidationannee.py
with
50 additions
and
4 deletions
app/but/jury_but.py
+
1
−
1
View file @
07acadd5
...
@@ -695,7 +695,7 @@ class DecisionsProposeesAnnee(DecisionsProposees):
...
@@ -695,7 +695,7 @@ class DecisionsProposeesAnnee(DecisionsProposees):
code
=
code
,
code
=
code
,
)
)
else
:
# Update validation année BUT
else
:
# Update validation année BUT
self
.
validation
.
etud
=
self
.
etud
assert
self
.
validation
.
etud
id
=
=
self
.
etud
.
id
self
.
validation
.
formsemestre
=
self
.
formsemestre_impair
self
.
validation
.
formsemestre
=
self
.
formsemestre_impair
self
.
validation
.
formation_id
=
self
.
formsemestre
.
formation_id
self
.
validation
.
formation_id
=
self
.
formsemestre
.
formation_id
self
.
validation
.
ordre
=
self
.
annee_but
self
.
validation
.
ordre
=
self
.
annee_but
...
...
This diff is collapsed.
Click to expand it.
app/models/but_validations.py
+
5
−
3
View file @
07acadd5
...
@@ -170,7 +170,9 @@ class ApcValidationAnnee(db.Model):
...
@@ -170,7 +170,9 @@ class ApcValidationAnnee(db.Model):
__tablename__
=
"
apc_validation_annee
"
__tablename__
=
"
apc_validation_annee
"
# Assure unicité de la décision:
# Assure unicité de la décision:
__table_args__
=
(
db
.
UniqueConstraint
(
"
etudid
"
,
"
annee_scolaire
"
,
"
ordre
"
),)
__table_args__
=
(
db
.
UniqueConstraint
(
"
etudid
"
,
"
ordre
"
,
"
formation_id
"
),
)
# il aurait été plus intelligent de mettre ici le refcomp
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
etudid
=
db
.
Column
(
etudid
=
db
.
Column
(
db
.
Integer
,
db
.
Integer
,
...
@@ -183,8 +185,8 @@ class ApcValidationAnnee(db.Model):
...
@@ -183,8 +185,8 @@ class ApcValidationAnnee(db.Model):
formsemestre_id
=
db
.
Column
(
formsemestre_id
=
db
.
Column
(
db
.
Integer
,
db
.
ForeignKey
(
"
notes_formsemestre.id
"
),
nullable
=
True
db
.
Integer
,
db
.
ForeignKey
(
"
notes_formsemestre.id
"
),
nullable
=
True
)
)
"
le semestre
origine, normalement l
'
IMPAIR (le 1er) de l
'
année
"
"
le semestre IMPAIR (le 1er) de l
'
année
"
formation_id
=
db
.
Column
(
formation_id
=
db
.
Column
(
# il aurait été plus intelligent de mettre ici le refcomp
db
.
Integer
,
db
.
Integer
,
db
.
ForeignKey
(
"
notes_formations.id
"
),
db
.
ForeignKey
(
"
notes_formations.id
"
),
nullable
=
False
,
nullable
=
False
,
...
...
This diff is collapsed.
Click to expand it.
migrations/versions/829683efddc4_change_apcvalidationannee.py
0 → 100644
+
44
−
0
View file @
07acadd5
"""
Change ApcValidationAnnee
Revision ID: 829683efddc4
Revises: c701224fa255
Create Date: 2023-06-28 09:47:16.591028
"""
from
alembic
import
op
import
sqlalchemy
as
sa
# revision identifiers, used by Alembic.
revision
=
"
829683efddc4
"
down_revision
=
"
c701224fa255
"
branch_labels
=
None
depends_on
=
None
def
upgrade
():
# ### commands auto generated by Alembic - please adjust! ###
with
op
.
batch_alter_table
(
"
apc_validation_annee
"
,
schema
=
None
)
as
batch_op
:
batch_op
.
drop_constraint
(
"
apc_validation_annee_etudid_annee_scolaire_ordre_key
"
,
type_
=
"
unique
"
)
# batch_op.create_unique_constraint(
# "apc_validation_annee_etudid_formation_ordre_key",
# ["etudid", "ordre", "formation_id"],
# )
# ### end Alembic commands ###
def
downgrade
():
# ### commands auto generated by Alembic - please adjust! ###
with
op
.
batch_alter_table
(
"
apc_validation_annee
"
,
schema
=
None
)
as
batch_op
:
# batch_op.drop_constraint(
# "apc_validation_annee_etudid_formation_ordre_key", type_="unique"
# )
batch_op
.
create_unique_constraint
(
"
apc_validation_annee_etudid_annee_scolaire_ordre_key
"
,
[
"
etudid
"
,
"
annee_scolaire
"
,
"
ordre
"
],
)
# ### end Alembic commands ###
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