Skip to content

Commit d9f51ea

Browse files
committed
Fix OS-1460: [V1.C.2] Back-office : Nouvelle gestion liée aux fraudeurs > Pastille d'en-tête, Données perso (dont nouvel état "Avis expert"), Décision SIC
1 parent 4e27d96 commit d9f51ea

File tree

13 files changed

+141
-65
lines changed

13 files changed

+141
-65
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ def get_status(self, status: str, extra: Optional[Dict[str, any]] = None) -> Opt
191191
statut=ChoixStatutChecklist.GEST_BLOCAGE,
192192
extra={'fraud': '0'},
193193
),
194+
ConfigurationStatutChecklist(
195+
identifiant='AVIS_EXPERT',
196+
libelle=_('Expert opinion'),
197+
statut=ChoixStatutChecklist.GEST_EN_COURS,
198+
),
194199
ConfigurationStatutChecklist(
195200
identifiant='FRAUDEUR',
196201
libelle=_('Fraudster'),

ddd/admission/formation_generale/dtos/proposition.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,8 @@ class PropositionGestionnaireDTO(PropositionDTO):
172172

173173
candidat_a_plusieurs_demandes: bool
174174

175-
titre_acces: str
176175
candidat_assimile: bool
177-
fraudeur_ares: bool
178-
non_financable: bool
176+
est_fraudeur: bool
179177
est_inscription_tardive: bool
180178

181179
profil_soumis_candidat: Optional[ProfilCandidatDTO]

infrastructure/admission/formation_generale/repository/proposition.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
BesoinDeDerogationDelegueVrae,
4848
ChoixStatutPropositionGenerale,
4949
DerogationFinancement,
50-
PoursuiteDeCycle,
50+
PoursuiteDeCycle, ChoixStatutChecklist,
5151
)
5252
from admission.ddd.admission.formation_generale.domain.model.proposition import (
5353
Proposition,
@@ -942,6 +942,7 @@ def _load_dto_for_gestionnaire(
942942
is_french_language = get_language() == settings.LANGUAGE_CODE_FR
943943
proposition = cls._load_dto(admission)
944944
poursuite_de_cycle_a_specifier = proposition.formation.type == TrainingType.BACHELOR.name
945+
checklist_actuelle = admission.checklist.get('current')
945946

946947
return PropositionGestionnaireDTO(
947948
**dto_to_dict(proposition),
@@ -975,12 +976,13 @@ def _load_dto_for_gestionnaire(
975976
poursuite_de_cycle_a_specifier=poursuite_de_cycle_a_specifier,
976977
poursuite_de_cycle=admission.cycle_pursuit if poursuite_de_cycle_a_specifier else '',
977978
candidat_a_plusieurs_demandes=admission.has_several_admissions_in_progress, # from annotation
978-
titre_acces='', # TODO
979979
candidat_assimile=admission.accounting
980980
and admission.accounting.assimilation_situation
981981
and admission.accounting.assimilation_situation != TypeSituationAssimilation.AUCUNE_ASSIMILATION.name,
982-
fraudeur_ares=False, # TODO
983-
non_financable=False, # TODO,
982+
est_fraudeur=(
983+
checklist_actuelle['donnees_personnelles']['statut'] == ChoixStatutChecklist.GEST_BLOCAGE.name
984+
and checklist_actuelle['donnees_personnelles']['extra'].get('fraud') == '1'
985+
) if checklist_actuelle else False,
984986
est_inscription_tardive=admission.late_enrollment,
985987
profil_soumis_candidat=(
986988
ProfilCandidatDTO.from_dict(

locale/en/LC_MESSAGES/django.po

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ msgid ""
142142
msgstr ""
143143

144144
msgid ""
145-
"<strong>Warning</strong> the candidate is reported as a <strong>fraudster</"
146-
"strong>"
145+
"<strong>Warning</strong> the candidate is reported as <strong>fraudster</"
146+
"strong> by the ARES"
147147
msgstr ""
148148

149149
#, python-format
@@ -3078,15 +3078,9 @@ msgstr ""
30783078
msgid "Fraudster"
30793079
msgstr ""
30803080

3081-
msgid "Fraudster (ARES)"
3082-
msgstr ""
3083-
30843081
msgid "Fraudster status from ARES"
30853082
msgstr ""
30863083

3087-
msgid "Fraudster status from SIC"
3088-
msgstr ""
3089-
30903084
msgid "Free additional approval condition"
30913085
msgstr ""
30923086

@@ -4533,9 +4527,6 @@ msgstr ""
45334527
msgid "No enrolment application"
45344528
msgstr ""
45354529

4536-
msgid "No fraud identified"
4537-
msgstr ""
4538-
45394530
msgid "No general enrolment"
45404531
msgstr ""
45414532

@@ -4644,9 +4635,6 @@ msgstr ""
46444635
msgid "Not free"
46454636
msgstr ""
46464637

4647-
msgid "Not fundable"
4648-
msgstr ""
4649-
46504638
msgctxt "dashboard-indicator admission"
46514639
msgid "Not in order of registration"
46524640
msgstr ""
@@ -5622,6 +5610,9 @@ msgstr ""
56225610
msgid "Requested on"
56235611
msgstr ""
56245612

5613+
msgid "Requesting fraud status from the ARES"
5614+
msgstr ""
5615+
56255616
#, python-format
56265617
msgid "Require changes for \"%(object)s\""
56275618
msgstr ""
@@ -5899,6 +5890,11 @@ msgstr ""
58995890
msgid "Sender"
59005891
msgstr ""
59015892

5893+
msgid ""
5894+
"Sending the authorization is impossible while the personal data are in the "
5895+
"\"Fraudster\" status."
5896+
msgstr ""
5897+
59025898
msgid "Sent to EPC"
59035899
msgstr ""
59045900

@@ -7236,6 +7232,9 @@ msgstr ""
72367232
msgid "UUID"
72377233
msgstr ""
72387234

7235+
msgid "Unable to get fraud status from the ARES at the moment"
7236+
msgstr ""
7237+
72397238
msgid "Unavailable"
72407239
msgstr ""
72417240

locale/fr_BE/LC_MESSAGES/django.po

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,11 @@ msgstr ""
173173
"l’adresse <a href=\"mailto:{mail}\">{mail}</a> :</p>"
174174

175175
msgid ""
176-
"<strong>Warning</strong> the candidate is reported as a <strong>fraudster</"
177-
"strong>"
176+
"<strong>Warning</strong> the candidate is reported as <strong>fraudster</"
177+
"strong> by the ARES"
178178
msgstr ""
179-
"<strong>Attention</strong> le candidat est signalé <strong>fraudeur</strong>"
179+
"<strong>Attention</strong> le candidat est signalé <strong>fraudeur</strong> "
180+
"par l'ARES"
180181

181182
#, python-format
182183
msgid ""
@@ -3373,15 +3374,9 @@ msgstr "Ancien·ne étudiant·e UCLouvain"
33733374
msgid "Fraudster"
33743375
msgstr "Fraudeur"
33753376

3376-
msgid "Fraudster (ARES)"
3377-
msgstr "Fraudeur (ARES)"
3378-
33793377
msgid "Fraudster status from ARES"
33803378
msgstr "Statut fraudeur d'après l'ARES"
33813379

3382-
msgid "Fraudster status from SIC"
3383-
msgstr "Statut fraudeur d'après SIC"
3384-
33853380
msgid "Free additional approval condition"
33863381
msgstr "Condition complémentaire d'acceptation libre"
33873382

@@ -5049,9 +5044,6 @@ msgstr "Aucune formation n'a été trouvée pour :"
50495044
msgid "No enrolment application"
50505045
msgstr "Aucune demande d'inscription n'a été trouvée"
50515046

5052-
msgid "No fraud identified"
5053-
msgstr "Pas de fraude identifiée"
5054-
50555047
msgid "No general enrolment"
50565048
msgstr "Aucune inscription en formation générale n'a été trouvée"
50575049

@@ -5160,9 +5152,6 @@ msgstr "Non finançable - %(rule)s (Établi par %(established_by)s)"
51605152
msgid "Not free"
51615153
msgstr "Non libre"
51625154

5163-
msgid "Not fundable"
5164-
msgstr "Non-finançable"
5165-
51665155
msgctxt "dashboard-indicator admission"
51675156
msgid "Not in order of registration"
51685157
msgstr "Pas en ordre d’inscription"
@@ -6211,6 +6200,9 @@ msgstr "Liste des documents réclamés"
62116200
msgid "Requested on"
62126201
msgstr "Réclamé le"
62136202

6203+
msgid "Requesting fraud status from the ARES"
6204+
msgstr "Demande du statut fraudeur depuis l'ARES"
6205+
62146206
#, python-format
62156207
msgid "Require changes for \"%(object)s\""
62166208
msgstr "Demander des changements pour \"%(object)s\""
@@ -6494,6 +6486,13 @@ msgstr "Envoyer en faculté"
64946486
msgid "Sender"
64956487
msgstr "Expéditeur"
64966488

6489+
msgid ""
6490+
"Sending the authorization is impossible while the personal data are in the "
6491+
"\"Fraudster\" status."
6492+
msgstr ""
6493+
"L’envoi de l’autorisation est impossible lorsque les données personnelles "
6494+
"sont à l'état \"Fraudeur\"."
6495+
64976496
msgid "Sent to EPC"
64986497
msgstr "Envoyée à EPC"
64996498

@@ -8069,6 +8068,9 @@ msgstr "UE"
80698068
msgid "UUID"
80708069
msgstr "UUID"
80718070

8071+
msgid "Unable to get fraud status from the ARES at the moment"
8072+
msgstr "Impossible de récupérer l'état fraudeur depuis l'ARES"
8073+
80728074
msgid "Unavailable"
80738075
msgstr "Non disponible"
80748076

templates/admission/general_education/checklist.html

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -438,22 +438,16 @@
438438
{% include "admission/general_education/includes/checklist/sic_decision_approval_final_modal.html" %}
439439
{% include "admission/general_education/includes/checklist/sic_decision_delegate_vrae_dispensation_modal.html" %}
440440

441+
{% if autres_demandes %}
441442
<div class="info-part">
442-
{% include 'admission/general_education/includes/checklist/sic_decision_sic_fraud_status.html' %}
443443
<dl>
444-
<dt>{% trans "Fraudster status from ARES" %}</dt>
445-
<dd class="mb-15">
446-
Not implemented yet.
447-
</dd>
448-
449-
{% if autres_demandes %}
450444
<dt>{% trans "Other demand(s) by the candidate." %}</dt>
451445
<dd>
452446
{% include 'admission/includes/lite_admission_list.html' with with_title=True %}
453447
</dd>
454-
{% endif %}
455448
</dl>
456449
</div>
450+
{% endif %}
457451

458452
</div>
459453

@@ -1069,6 +1063,19 @@
10691063
htmx.trigger('#financabilite-computed-rule', 'financabiliteComputeRule');
10701064
});
10711065

1066+
// Update ares result
1067+
$('#list-group-link-donnees_personnelles').on('show.bs.tab', function() {
1068+
if (document.getElementById('ares-fraudster-result-donnees_personnelles') !== null) {
1069+
htmx.trigger('#ares-fraudster-result-donnees_personnelles', 'fraudAresResult');
1070+
}
1071+
});
1072+
1073+
$('#list-group-link-decision_sic').on('show.bs.tab', function() {
1074+
if (document.getElementById('ares-fraudster-result-decision_sic') !== null) {
1075+
htmx.trigger('#ares-fraudster-result-decision_sic', 'fraudAresResult');
1076+
}
1077+
});
1078+
10721079
// Pass the ckeditor data to the form data if necessary
10731080
$(document).on('click', '.ckeditor-form [type="submit"], .ckeditor-form [name="save"]', function(event) {
10741081
$(this).closest('form').find("textarea").each(function() {

templates/admission/general_education/includes/checklist/sic_decision_sic_fraud_status.html renamed to templates/admission/general_education/includes/checklist/fraud_ares_status.html

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* The core business involves the administration of students, teachers,
88
* courses, programs and so on.
99
*
10-
* Copyright (C) 2015-2024 Université catholique de Louvain (http://www.uclouvain.be)
10+
* Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
1111
*
1212
* This program is free software: you can redistribute it and/or modify
1313
* it under the terms of the GNU General Public License as published by
@@ -24,10 +24,23 @@
2424
* see http://www.gnu.org/licenses/.
2525
{% endcomment %}
2626

27-
<div id="sic-decision-sic-fraud-status" hx-swap-oob="true">
28-
{% if original_admission.checklist.current.donnees_personnelles.statut == 'GEST_BLOCAGE' and original_admission.checklist.current.donnees_personnelles.extra.fraud == '1' %}
29-
{% field_data _('Fraudster status from SIC') _('Fraudster') css_class='bg-danger' html_tag='span' %}
30-
{% else %}
31-
{% field_data _('Fraudster status from SIC') _('No fraud identified') %}
32-
{% endif %}
33-
</div>
27+
{% if is_fraudster_from_ares_error %}
28+
<div class="alert alert-warning">
29+
{% blocktranslate %}Unable to get fraud status from the ARES at the moment{% endblocktranslate %}
30+
</div>
31+
{% elif is_fraudster_from_ares is True %}
32+
<div class="alert alert-danger">
33+
{% blocktranslate %}<strong>Warning</strong> the candidate is reported as <strong>fraudster</strong> by the ARES{% endblocktranslate %}
34+
</div>
35+
{% elif is_fraudster_from_ares is False %}
36+
{% else %}
37+
<div hx-post="{% url view.base_namespace|add:':fraudster-check' uuid=view.kwargs.uuid %}"
38+
hx-trigger="fraudAresResult"
39+
hx-swap="outerHTML"
40+
id="ares-fraudster-result-{{ container_id }}"
41+
>
42+
<div class="alert alert-info">
43+
<i class="fas fa-spinner fa-spin-pulse"></i> {% blocktranslate %}Requesting fraud status from the ARES{% endblocktranslate %}
44+
</div>
45+
</div>
46+
{% endif %}

templates/admission/general_education/includes/checklist/personal_data.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
{% endif %}
3131

3232
{% with initial=original_admission.checklist.initial.donnees_personnelles current=original_admission.checklist.current.donnees_personnelles can_update_checklist_tab=can_update_personal_data_tab %}
33+
{% include 'admission/general_education/includes/checklist/fraud_ares_status.html' with container_id="donnees_personnelles" %}
3334
<div
3435
id="personal-data-statuses"
3536
class="form-group btn-group status-group"
@@ -39,6 +40,7 @@
3940
{% concat view.base_namespace ':personal-data-change-status' as personal_data_base_url %}
4041
{% url personal_data_base_url view.kwargs.uuid initial.statut as initial_status_url %}
4142
{% url personal_data_base_url view.kwargs.uuid 'GEST_EN_COURS' as in_progress_status_url %}
43+
{% url personal_data_base_url view.kwargs.uuid 'GEST_EN_COURS' as ongoing_status_url %}
4244
{% url personal_data_base_url view.kwargs.uuid 'GEST_BLOCAGE' as blocking_status_url %}
4345
{% url personal_data_base_url view.kwargs.uuid 'GEST_REUSSITE' as success_status_url %}
4446
{% translate initial.libelle as initial_state_label %}
@@ -54,12 +56,14 @@
5456
{% checklist_state_button tab='donnees_personnelles' label=initial_state_label icon='user' state=initial.statut class='muted' htmx_post=initial_status_url disabled=cannot_change_personal_data_checklist_status_to_be_processed force_enabled=True %}
5557
{% checklist_state_button tab='donnees_personnelles' label=cleaned_label icon='pencil' state='GEST_EN_COURS' class='warning' htmx_post=in_progress_status_url disabled=cannot_change_personal_data_checklist_status_cleaned force_enabled=True %}
5658
{% checklist_state_button tab='donnees_personnelles' label=_("To be completed") icon='circle-stop' state='GEST_BLOCAGE' class='danger' fraud='0' htmx_post=blocking_status_url %}
59+
{% checklist_state_button tab='donnees_personnelles' label=_("Expert opinion") icon='pencil' state='GEST_EN_COURS' class='warning' en_cours='expert_opinion' htmx_post=ongoing_status_url %}
5760
{% checklist_state_button tab='donnees_personnelles' label=_("Fraudster") icon='circle-stop' state='GEST_BLOCAGE' class='danger' fraud='1' htmx_post=blocking_status_url %}
5861
{% checklist_state_button tab='donnees_personnelles' label=validated_label icon='check' state='GEST_REUSSITE' class='success' htmx_post=success_status_url %}
5962
</div>
6063
{% if request.htmx %}
6164
{# Update the checklist menu item status #}
6265
{% include "admission/general_education/checklist_menu_item_status.html" with statut=current.statut item_name='donnees_personnelles' %}
66+
6367
{# Update the sic decision statuses #}
6468
{% if view.is_doctorate %}
6569
{% include 'admission/doctorate/includes/checklist/sic_decision_statuses.html' with proposition=admission current=original_admission.checklist.current.decision_sic %}

templates/admission/general_education/includes/checklist/sic_decision.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
id="sic-decision-container"
3030
hx-swap-oob="true"
3131
>
32+
{% include 'admission/general_education/includes/checklist/fraud_ares_status.html' with container_id="decision_sic" %}
3233
{% if view.is_doctorate %}
3334
{% include 'admission/doctorate/includes/checklist/sic_decision_statuses.html' with proposition=resume_proposition.proposition current=current %}
3435
{% else %}

templates/admission/general_education/includes/checklist/sic_decision_approval_final_form.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* The core business involves the administration of students, teachers,
88
* courses, programs and so on.
99
*
10-
* Copyright (C) 2015-2024 Université catholique de Louvain (http://www.uclouvain.be)
10+
* Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
1111
*
1212
* This program is free software: you can redistribute it and/or modify
1313
* it under the terms of the GNU General Public License as published by
@@ -38,9 +38,6 @@ <h3 class="modal-title" id="myModalLabel">{% translate "SIC Approval" %}</h3>
3838
</div>
3939

4040
<div class="modal-body" style="overflow:auto;">
41-
{% if original_admission.checklist.current.donnees_personnelles.statut == 'GEST_BLOCAGE' and original_admission.checklist.current.donnees_personnelles.extra.fraud == '1' %}
42-
<div class="alert alert-danger">{% trans "<strong>Warning</strong> the candidate is reported as a <strong>fraudster</strong>" %}</div>
43-
{% endif %}
4441

4542
<div class="form-group"><strong>{% trans "Contact language" %}</strong> <span class="label label-admission-primary">{{ admission.langue_contact_candidat|formatted_language }}</span></div>
4643

@@ -56,6 +53,7 @@ <h3 class="modal-title" id="myModalLabel">{% translate "SIC Approval" %}</h3>
5653

5754
<div class="modal-footer">
5855
{% translate 'The authorization can not be done while there is one or more documents to be requested immediately.' as has_requested_documents_disabled_str %}
56+
{% translate 'Sending the authorization is impossible while the personal data are in the "Fraudster" status.' as fraudster_disabled_str %}
5957
{% if original_admission.type_demande == 'ADMISSION' %}
6058
<a
6159
class="btn btn-default"
@@ -86,6 +84,13 @@ <h3 class="modal-title" id="myModalLabel">{% translate "SIC Approval" %}</h3>
8684
data-trigger="hover"
8785
data-container="body"
8886
data-content="{{ has_requested_documents_disabled_str|force_escape }}"
87+
{% elif original_admission.checklist.current.donnees_personnelles.statut == 'GEST_BLOCAGE' and original_admission.checklist.current.donnees_personnelles.extra.fraud == '1' %}
88+
disabled
89+
data-toggle="popover"
90+
data-placement="auto top"
91+
data-trigger="hover"
92+
data-container="body"
93+
data-content="{{ fraudster_disabled_str|force_escape }}"
8994
{% else %}
9095
{% switch "admission_decision_sic_button" %}{% else %}disabled{% endswitch %}
9196
{% endif %}

0 commit comments

Comments
 (0)