Skip to content

Commit 9bd052f

Browse files
committed
[OS-1689] Checklist > personal data > add a new state and add editing permissions to the program managers
1 parent 2ab6767 commit 9bd052f

File tree

21 files changed

+495
-90
lines changed

21 files changed

+495
-90
lines changed

auth/predicates/common.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# The core business involves the administration of students, teachers,
77
# courses, programs and so on.
88
#
9-
# Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
9+
# Copyright (C) 2015-2026 Université catholique de Louvain (http://www.uclouvain.be)
1010
#
1111
# This program is free software: you can redistribute it and/or modify
1212
# it under the terms of the GNU General Public License as published by
@@ -224,3 +224,29 @@ def past_experiences_checklist_tab_is_not_sufficient(
224224
obj: Union[DoctorateAdmission, GeneralEducationAdmission],
225225
):
226226
return obj.checklist.get('current', {}).get('parcours_anterieur', {}).get('statut') != 'GEST_REUSSITE'
227+
228+
229+
@predicate(bind=True)
230+
@predicate_failed_msg(
231+
message=_("The \"Personal data\" checklist tab must be in the \"Cleaned\" status in order to do this action.")
232+
)
233+
def personal_data_checklist_status_is_cleaned(self, user: User, obj: BaseAdmission):
234+
return obj.checklist.get('current', {}).get('donnees_personnelles', {}).get('statut') == 'GEST_EN_COURS'
235+
236+
237+
@predicate(bind=True)
238+
@predicate_failed_msg(
239+
message=_(
240+
"The \"Personal data\" checklist tab must be in the \"To be processed\" status in order to do this action."
241+
)
242+
)
243+
def personal_data_checklist_status_is_to_be_processed(self, user: User, obj: BaseAdmission):
244+
return obj.checklist.get('current', {}).get('donnees_personnelles', {}).get('statut') == 'INITIAL_CANDIDAT'
245+
246+
247+
@predicate(bind=True)
248+
@predicate_failed_msg(
249+
message=_("The \"Personal data\" checklist tab must not be in the \"Validated\" status in order to do this action.")
250+
)
251+
def personal_data_checklist_status_is_not_validated(self, user: User, obj: BaseAdmission):
252+
return obj.checklist.get('current', {}).get('donnees_personnelles', {}).get('statut') != 'GEST_REUSSITE'

auth/predicates/doctorate.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# The core business involves the administration of students, teachers,
77
# courses, programs and so on.
88
#
9-
# Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
9+
# Copyright (C) 2015-2026 Université catholique de Louvain (http://www.uclouvain.be)
1010
#
1111
# This program is free software: you can redistribute it and/or modify
1212
# it under the terms of the GNU General Public License as published by
@@ -37,6 +37,7 @@
3737
STATUTS_PROPOSITION_DOCTORALE_SOUMISE_POUR_CANDIDAT,
3838
STATUTS_PROPOSITION_DOCTORALE_SOUMISE_POUR_CDD,
3939
STATUTS_PROPOSITION_DOCTORALE_SOUMISE_POUR_CDD_ETENDUS,
40+
STATUTS_PROPOSITION_DOCTORALE_SOUMISE_POUR_GESTIONNAIRE,
4041
STATUTS_PROPOSITION_DOCTORALE_SOUMISE_POUR_SIC,
4142
STATUTS_PROPOSITION_DOCTORALE_SOUMISE_POUR_SIC_ETENDUS,
4243
ChoixStatutPropositionDoctorale,
@@ -235,3 +236,11 @@ def can_send_to_fac_faculty_decision(self, user: User, obj: DoctorateAdmission):
235236
@predicate_failed_msg(message=_("The admission must not follow a pre-admission"))
236237
def must_not_follow_a_pre_admission(self, user: User, obj: DoctorateAdmission):
237238
return not bool(obj.related_pre_admission_id)
239+
240+
241+
@predicate(bind=True)
242+
@predicate_failed_msg(
243+
not_in_doctorate_statuses_predicate_message(STATUTS_PROPOSITION_DOCTORALE_SOUMISE_POUR_GESTIONNAIRE)
244+
)
245+
def in_manager_status(self, user: User, obj: DoctorateAdmission):
246+
return isinstance(obj, DoctorateAdmission) and obj.status in STATUTS_PROPOSITION_DOCTORALE_SOUMISE_POUR_GESTIONNAIRE

auth/predicates/general.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# The core business involves the administration of students, teachers,
77
# courses, programs and so on.
88
#
9-
# Copyright (C) 2015-2024 Université catholique de Louvain (http://www.uclouvain.be)
9+
# Copyright (C) 2015-2026 Université catholique de Louvain (http://www.uclouvain.be)
1010
#
1111
# This program is free software: you can redistribute it and/or modify
1212
# it under the terms of the GNU General Public License as published by
@@ -29,18 +29,19 @@
2929
from rules import predicate
3030

3131
from admission.auth.predicates import not_in_general_statuses_predicate_message
32-
from admission.models import GeneralEducationAdmission
3332
from admission.ddd.admission.formation_generale.domain.model.enums import (
34-
ChoixStatutPropositionGenerale,
35-
ChoixStatutChecklist,
33+
STATUTS_PROPOSITION_GENERALE_ENVOYABLE_EN_FAC_POUR_DECISION,
34+
STATUTS_PROPOSITION_GENERALE_SOUMISE,
3635
STATUTS_PROPOSITION_GENERALE_SOUMISE_POUR_FAC,
37-
STATUTS_PROPOSITION_GENERALE_SOUMISE_POUR_SIC,
3836
STATUTS_PROPOSITION_GENERALE_SOUMISE_POUR_FAC_ETENDUS,
37+
STATUTS_PROPOSITION_GENERALE_SOUMISE_POUR_GESTIONNAIRE,
38+
STATUTS_PROPOSITION_GENERALE_SOUMISE_POUR_SIC,
3939
STATUTS_PROPOSITION_GENERALE_SOUMISE_POUR_SIC_ETENDUS,
40-
STATUTS_PROPOSITION_GENERALE_SOUMISE,
4140
STATUTS_PROPOSITION_GENERALE_SOUMISE_POUR_SIC_OU_FRAIS_DOSSIER_EN_ATTENTE,
42-
STATUTS_PROPOSITION_GENERALE_ENVOYABLE_EN_FAC_POUR_DECISION,
41+
ChoixStatutChecklist,
42+
ChoixStatutPropositionGenerale,
4343
)
44+
from admission.models import GeneralEducationAdmission
4445
from osis_role.errors import predicate_failed_msg
4546

4647

@@ -116,6 +117,15 @@ def in_fac_status(self, user: User, obj: GeneralEducationAdmission):
116117
return isinstance(obj, GeneralEducationAdmission) and obj.status in STATUTS_PROPOSITION_GENERALE_SOUMISE_POUR_FAC
117118

118119

120+
@predicate(bind=True)
121+
@predicate_failed_msg(not_in_general_statuses_predicate_message(STATUTS_PROPOSITION_GENERALE_SOUMISE_POUR_GESTIONNAIRE))
122+
def in_manager_status(self, user: User, obj: GeneralEducationAdmission):
123+
return (
124+
isinstance(obj, GeneralEducationAdmission)
125+
and obj.status in STATUTS_PROPOSITION_GENERALE_SOUMISE_POUR_GESTIONNAIRE
126+
)
127+
128+
119129
@predicate(bind=True)
120130
@predicate_failed_msg(not_in_general_statuses_predicate_message(STATUTS_PROPOSITION_GENERALE_SOUMISE_POUR_FAC_ETENDUS))
121131
def in_fac_status_extended(self, user: User, obj: GeneralEducationAdmission):

auth/roles/central_manager.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# The core business involves the administration of students, teachers,
77
# courses, programs and so on.
88
#
9-
# Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
9+
# Copyright (C) 2015-2026 Université catholique de Louvain (http://www.uclouvain.be)
1010
#
1111
# This program is free software: you can redistribute it and/or modify
1212
# it under the terms of the GNU General Public License as published by
@@ -34,16 +34,14 @@
3434
candidate_has_other_doctorate_or_general_admissions,
3535
has_scope,
3636
is_debug,
37-
)
38-
from admission.auth.predicates.common import (
39-
is_entity_manager as is_entity_manager_without_scope,
40-
)
41-
from admission.auth.predicates.common import (
4237
is_scoped_entity_manager,
4338
is_sent_to_epc,
4439
past_experiences_checklist_tab_is_not_sufficient,
4540
workflow_injection_signaletique_en_cours,
4641
)
42+
from admission.auth.predicates.common import (
43+
is_entity_manager as is_entity_manager_without_scope,
44+
)
4745
from admission.auth.scope import Scope
4846
from osis_role.contrib.models import EntityRoleModel
4947

@@ -199,6 +197,12 @@ def common_rule_set(cls, is_entity_manager: callable):
199197
'admission.change_checklist': is_entity_manager
200198
& (general.in_sic_status | continuing.is_submitted | doctorate.in_sic_status)
201199
& ~is_sent_to_epc,
200+
'admission.change_personal_data_checklist_status_to_be_processed': is_entity_manager
201+
& (general.in_sic_status | doctorate.in_sic_status)
202+
& ~is_sent_to_epc,
203+
'admission.change_personal_data_checklist_status_cleaned': is_entity_manager
204+
& (general.in_sic_status | doctorate.in_sic_status)
205+
& ~is_sent_to_epc,
202206
'admission.change_checklist_iufc': is_entity_manager & continuing.is_submitted & ~is_sent_to_epc,
203207
'admission.cancel_admission_iufc': is_entity_manager & continuing.is_submitted,
204208
'admission.change_payment': is_entity_manager & general.in_sic_status_or_application_fees & ~is_sent_to_epc,

auth/roles/program_manager.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# The core business involves the administration of students, teachers,
77
# courses, programs and so on.
88
#
9-
# Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
9+
# Copyright (C) 2015-2026 Université catholique de Louvain (http://www.uclouvain.be)
1010
#
1111
# This program is free software: you can redistribute it and/or modify
1212
# it under the terms of the GNU General Public License as published by
@@ -36,6 +36,9 @@
3636
is_part_of_education_group,
3737
is_sent_to_epc,
3838
past_experiences_checklist_tab_is_not_sufficient,
39+
personal_data_checklist_status_is_cleaned,
40+
personal_data_checklist_status_is_not_validated,
41+
personal_data_checklist_status_is_to_be_processed,
3942
workflow_injection_signaletique_en_cours,
4043
)
4144
from admission.infrastructure.admission.shared_kernel.domain.service.annee_inscription_formation import (
@@ -87,13 +90,20 @@ def rule_set(cls):
8790
# Profile
8891
'admission.view_admission_person': is_part_of_education_group,
8992
'admission.change_admission_person': is_part_of_education_group
90-
& continuing.in_manager_status
93+
& (
94+
general.in_manager_status & personal_data_checklist_status_is_not_validated
95+
| continuing.in_manager_status & ~candidate_has_other_doctorate_or_general_admissions
96+
| doctorate.in_manager_status & personal_data_checklist_status_is_not_validated
97+
)
9198
& ~is_sent_to_epc
92-
& ~workflow_injection_signaletique_en_cours
93-
& ~candidate_has_other_doctorate_or_general_admissions,
99+
& ~workflow_injection_signaletique_en_cours,
94100
'admission.view_admission_coordinates': is_part_of_education_group,
95101
'admission.change_admission_coordinates': is_part_of_education_group
96-
& continuing.in_manager_status
102+
& (
103+
general.in_manager_status & personal_data_checklist_status_is_not_validated
104+
| continuing.in_manager_status
105+
| doctorate.in_manager_status & personal_data_checklist_status_is_not_validated
106+
)
97107
& ~is_sent_to_epc
98108
& ~workflow_injection_signaletique_en_cours,
99109
'admission.view_admission_secondary_studies': is_part_of_education_group,
@@ -188,6 +198,14 @@ def rule_set(cls):
188198
& continuing.is_continuing
189199
& continuing.is_submitted
190200
& ~is_sent_to_epc,
201+
'admission.change_personal_data_checklist_status_to_be_processed': is_part_of_education_group
202+
& (general.in_manager_status | doctorate.in_manager_status)
203+
& personal_data_checklist_status_is_cleaned
204+
& ~is_sent_to_epc,
205+
'admission.change_personal_data_checklist_status_cleaned': is_part_of_education_group
206+
& (general.in_manager_status | doctorate.in_manager_status)
207+
& personal_data_checklist_status_is_to_be_processed
208+
& ~is_sent_to_epc,
191209
'admission.cancel_admission_iufc': is_part_of_education_group
192210
& continuing.is_submitted
193211
& ~continuing.is_validated

ddd/admission/doctorat/preparation/domain/model/enums/projet.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# The core business involves the administration of students, teachers,
77
# courses, programs and so on.
88
#
9-
# Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
9+
# Copyright (C) 2015-2026 Université catholique de Louvain (http://www.uclouvain.be)
1010
#
1111
# This program is free software: you can redistribute it and/or modify
1212
# it under the terms of the GNU General Public License as published by
@@ -138,6 +138,16 @@ def get_specific_values(cls, keys: Iterable[str]):
138138
}
139139

140140

141+
# Le gestionnaire FAC ou SIC à la main hors inscription autorisée
142+
STATUTS_PROPOSITION_DOCTORALE_SOUMISE_POUR_GESTIONNAIRE = (
143+
STATUTS_PROPOSITION_DOCTORALE_SOUMISE_POUR_CDD
144+
| STATUTS_PROPOSITION_DOCTORALE_SOUMISE_POUR_SIC
145+
- {
146+
ChoixStatutPropositionDoctorale.INSCRIPTION_AUTORISEE.name,
147+
}
148+
)
149+
150+
141151
class ChoixCommissionProximiteCDEouCLSM(ChoiceEnum):
142152
ECONOMY = _('ECONOMY')
143153
MANAGEMENT = _('MANAGEMENT')

ddd/admission/doctorat/preparation/domain/model/statut_checklist.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# The core business involves the administration of students, teachers,
77
# courses, programs and so on.
88
#
9-
# Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
9+
# Copyright (C) 2015-2026 Université catholique de Louvain (http://www.uclouvain.be)
1010
#
1111
# This program is free software: you can redistribute it and/or modify
1212
# it under the terms of the GNU General Public License as published by
@@ -95,7 +95,8 @@ def recuperer_enfant(self, onglet, identifiant_enfant) -> StatutChecklist:
9595

9696

9797
INDEX_ONGLETS_CHECKLIST = {
98-
onglet: index for index, onglet in enumerate(attr.fields_dict(StatutsChecklistDoctorale)) # type: ignore
98+
onglet: index
99+
for index, onglet in enumerate(attr.fields_dict(StatutsChecklistDoctorale)) # type: ignore
99100
}
100101

101102

@@ -159,6 +160,11 @@ def get_status(self, status: str, extra: Optional[Dict[str, any]] = None) -> Opt
159160
libelle=_('To be processed'),
160161
statut=ChoixStatutChecklist.INITIAL_CANDIDAT,
161162
),
163+
ConfigurationStatutChecklist(
164+
identifiant='TOILETTEES',
165+
libelle=pgettext_lazy('plural', 'Cleaned'),
166+
statut=ChoixStatutChecklist.GEST_EN_COURS,
167+
),
162168
ConfigurationStatutChecklist(
163169
identifiant='A_COMPLETER',
164170
libelle=_('To be completed'),
@@ -173,7 +179,7 @@ def get_status(self, status: str, extra: Optional[Dict[str, any]] = None) -> Opt
173179
),
174180
ConfigurationStatutChecklist(
175181
identifiant='VALIDEES',
176-
libelle=_('Validated'),
182+
libelle=pgettext_lazy('plural', 'Validated'),
177183
statut=ChoixStatutChecklist.GEST_REUSSITE,
178184
),
179185
],

ddd/admission/formation_generale/domain/model/enums.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# The core business involves the administration of students, teachers,
77
# courses, programs and so on.
88
#
9-
# Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
9+
# Copyright (C) 2015-2026 Université catholique de Louvain (http://www.uclouvain.be)
1010
#
1111
# This program is free software: you can redistribute it and/or modify
1212
# it under the terms of the GNU General Public License as published by
@@ -150,6 +150,15 @@ def get_status_priorities(cls):
150150
- STATUTS_PROPOSITION_GENERALE_NON_SOUMISE_OU_FRAIS_DOSSIER_EN_ATTENTE
151151
)
152152

153+
# Le gestionnaire FAC ou SIC à la main hors inscription autorisée
154+
STATUTS_PROPOSITION_GENERALE_SOUMISE_POUR_GESTIONNAIRE = (
155+
STATUTS_PROPOSITION_GENERALE_SOUMISE_POUR_FAC
156+
| STATUTS_PROPOSITION_GENERALE_SOUMISE_POUR_SIC
157+
- {
158+
ChoixStatutPropositionGenerale.INSCRIPTION_AUTORISEE.name,
159+
}
160+
)
161+
153162

154163
class ChoixStatutChecklist(ChoiceEnum):
155164
INITIAL_NON_CONCERNE = _("INITIAL_NON_CONCERNE")

ddd/admission/formation_generale/domain/model/statut_checklist.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# The core business involves the administration of students, teachers,
77
# courses, programs and so on.
88
#
9-
# Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
9+
# Copyright (C) 2015-2026 Université catholique de Louvain (http://www.uclouvain.be)
1010
#
1111
# This program is free software: you can redistribute it and/or modify
1212
# it under the terms of the GNU General Public License as published by
@@ -115,7 +115,8 @@ def recuperer_enfant(self, onglet, identifiant_enfant) -> StatutChecklist:
115115

116116

117117
INDEX_ONGLETS_CHECKLIST = {
118-
onglet: index for index, onglet in enumerate(attr.fields_dict(StatutsChecklistGenerale)) # type: ignore
118+
onglet: index
119+
for index, onglet in enumerate(attr.fields_dict(StatutsChecklistGenerale)) # type: ignore
119120
}
120121

121122

@@ -179,6 +180,11 @@ def get_status(self, status: str, extra: Optional[Dict[str, any]] = None) -> Opt
179180
libelle=_('To be processed'),
180181
statut=ChoixStatutChecklist.INITIAL_CANDIDAT,
181182
),
183+
ConfigurationStatutChecklist(
184+
identifiant='TOILETTEES',
185+
libelle=pgettext_lazy('plural', 'Cleaned'),
186+
statut=ChoixStatutChecklist.GEST_EN_COURS,
187+
),
182188
ConfigurationStatutChecklist(
183189
identifiant='A_COMPLETER',
184190
libelle=_('To be completed'),
@@ -193,7 +199,7 @@ def get_status(self, status: str, extra: Optional[Dict[str, any]] = None) -> Opt
193199
),
194200
ConfigurationStatutChecklist(
195201
identifiant='VALIDEES',
196-
libelle=_('Validated'),
202+
libelle=pgettext_lazy('plural', 'Validated'),
197203
statut=ChoixStatutChecklist.GEST_REUSSITE,
198204
),
199205
],

locale/en/LC_MESSAGES/django.po

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,10 @@ msgstr ""
14591459
msgid "Cleaned"
14601460
msgstr ""
14611461

1462+
msgctxt "plural"
1463+
msgid "Cleaned"
1464+
msgstr ""
1465+
14621466
msgid "Clear the reason"
14631467
msgstr ""
14641468

@@ -6254,6 +6258,21 @@ msgstr ""
62546258
msgid "Text size"
62556259
msgstr ""
62566260

6261+
msgid ""
6262+
"The \"Personal data\" checklist tab must be in the \"Cleaned\" status in "
6263+
"order to do this action."
6264+
msgstr ""
6265+
6266+
msgid ""
6267+
"The \"Personal data\" checklist tab must be in the \"To be processed\" "
6268+
"status in order to do this action."
6269+
msgstr ""
6270+
6271+
msgid ""
6272+
"The \"Personal data\" checklist tab must not be in the \"Validated\" status "
6273+
"in order to do this action."
6274+
msgstr ""
6275+
62576276
msgid ""
62586277
"The \"Sufficient\" status requires the equivalence information to be "
62596278
"specified."
@@ -7266,6 +7285,10 @@ msgctxt "decision-checklist"
72667285
msgid "Validated"
72677286
msgstr ""
72687287

7288+
msgctxt "plural"
7289+
msgid "Validated"
7290+
msgstr ""
7291+
72697292
msgid "Valuated diplomas or experiences:"
72707293
msgstr ""
72717294

0 commit comments

Comments
 (0)