Skip to content

Commit e55d6cc

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 e132f94 commit e55d6cc

File tree

13 files changed

+133
-65
lines changed

13 files changed

+133
-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
@@ -185,6 +185,11 @@ def get_status(self, status: str, extra: Optional[Dict[str, any]] = None) -> Opt
185185
statut=ChoixStatutChecklist.GEST_BLOCAGE,
186186
extra={'fraud': '0'},
187187
),
188+
ConfigurationStatutChecklist(
189+
identifiant='AVIS_EXPERT',
190+
libelle=_('Expert opinion'),
191+
statut=ChoixStatutChecklist.GEST_EN_COURS,
192+
),
188193
ConfigurationStatutChecklist(
189194
identifiant='FRAUDEUR',
190195
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
@@ -3019,15 +3019,9 @@ msgstr ""
30193019
msgid "Fraudster"
30203020
msgstr ""
30213021

3022-
msgid "Fraudster (ARES)"
3023-
msgstr ""
3024-
30253022
msgid "Fraudster status from ARES"
30263023
msgstr ""
30273024

3028-
msgid "Fraudster status from SIC"
3029-
msgstr ""
3030-
30313025
msgid "Free additional approval condition"
30323026
msgstr ""
30333027

@@ -4453,9 +4447,6 @@ msgstr ""
44534447
msgid "No enrolment application"
44544448
msgstr ""
44554449

4456-
msgid "No fraud identified"
4457-
msgstr ""
4458-
44594450
msgid "No general enrolment"
44604451
msgstr ""
44614452

@@ -4558,9 +4549,6 @@ msgstr ""
45584549
msgid "Not free"
45594550
msgstr ""
45604551

4561-
msgid "Not fundable"
4562-
msgstr ""
4563-
45644552
msgctxt "dashboard-indicator admission"
45654553
msgid "Not in order of registration"
45664554
msgstr ""
@@ -5518,6 +5506,9 @@ msgstr ""
55185506
msgid "Requested on"
55195507
msgstr ""
55205508

5509+
msgid "Requesting fraud status from the ARES"
5510+
msgstr ""
5511+
55215512
#, python-format
55225513
msgid "Require changes for \"%(object)s\""
55235514
msgstr ""
@@ -5792,6 +5783,11 @@ msgstr ""
57925783
msgid "Sender"
57935784
msgstr ""
57945785

5786+
msgid ""
5787+
"Sending the authorization is impossible while the personal data are in the "
5788+
"\"Fraudster\" status."
5789+
msgstr ""
5790+
57955791
msgid "Sent to EPC"
57965792
msgstr ""
57975793

@@ -7095,6 +7091,9 @@ msgstr ""
70957091
msgid "UUID"
70967092
msgstr ""
70977093

7094+
msgid "Unable to get fraud status from the ARES at the moment"
7095+
msgstr ""
7096+
70987097
msgid "Unavailable"
70997098
msgstr ""
71007099

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 ""
@@ -3309,15 +3310,9 @@ msgstr "Ancien·ne étudiant·e UCLouvain"
33093310
msgid "Fraudster"
33103311
msgstr "Fraudeur"
33113312

3312-
msgid "Fraudster (ARES)"
3313-
msgstr "Fraudeur (ARES)"
3314-
33153313
msgid "Fraudster status from ARES"
33163314
msgstr "Statut fraudeur d'après l'ARES"
33173315

3318-
msgid "Fraudster status from SIC"
3319-
msgstr "Statut fraudeur d'après SIC"
3320-
33213316
msgid "Free additional approval condition"
33223317
msgstr "Condition complémentaire d'acceptation libre"
33233318

@@ -4961,9 +4956,6 @@ msgstr ""
49614956
msgid "No enrolment application"
49624957
msgstr "Aucune demande d'inscription n'a été trouvée"
49634958

4964-
msgid "No fraud identified"
4965-
msgstr "Pas de fraude identifiée"
4966-
49674959
msgid "No general enrolment"
49684960
msgstr "Aucune inscription en formation générale n'a été trouvée"
49694961

@@ -5066,9 +5058,6 @@ msgstr "Non finançable - %(rule)s (Établi par %(established_by)s)"
50665058
msgid "Not free"
50675059
msgstr "Non libre"
50685060

5069-
msgid "Not fundable"
5070-
msgstr "Non-finançable"
5071-
50725061
msgctxt "dashboard-indicator admission"
50735062
msgid "Not in order of registration"
50745063
msgstr "Pas en ordre d’inscription"
@@ -6097,6 +6086,9 @@ msgstr "Liste des documents réclamés"
60976086
msgid "Requested on"
60986087
msgstr "Réclamé le"
60996088

6089+
msgid "Requesting fraud status from the ARES"
6090+
msgstr "Demande du statut fraudeur depuis l'ARES"
6091+
61006092
#, python-format
61016093
msgid "Require changes for \"%(object)s\""
61026094
msgstr "Demander des changements pour \"%(object)s\""
@@ -6377,6 +6369,13 @@ msgstr "Envoyer en faculté"
63776369
msgid "Sender"
63786370
msgstr "Expéditeur"
63796371

6372+
msgid ""
6373+
"Sending the authorization is impossible while the personal data are in the "
6374+
"\"Fraudster\" status."
6375+
msgstr ""
6376+
"L’envoi de l’autorisation est impossible lorsque les données personnelles "
6377+
"sont à l'état \"Fraudeur\"."
6378+
63806379
msgid "Sent to EPC"
63816380
msgstr "Envoyée à EPC"
63826381

@@ -7900,6 +7899,9 @@ msgstr "UE"
79007899
msgid "UUID"
79017900
msgstr "UUID"
79027901

7902+
msgid "Unable to get fraud status from the ARES at the moment"
7903+
msgstr "Impossible de récupérer l'état fraudeur depuis l'ARES"
7904+
79037905
msgid "Unavailable"
79047906
msgstr "Non disponible"
79057907

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
@@ -24,6 +24,7 @@
2424
{% endcomment %}
2525

2626
{% with initial=original_admission.checklist.initial.donnees_personnelles current=original_admission.checklist.current.donnees_personnelles %}
27+
{% include 'admission/general_education/includes/checklist/fraud_ares_status.html' with container_id="donnees_personnelles" %}
2728
<div
2829
id="personal-data-statuses"
2930
class="form-group btn-group status-group"
@@ -32,17 +33,20 @@
3233
>
3334
{% concat view.base_namespace ':personal-data-change-status' as personal_data_base_url %}
3435
{% url personal_data_base_url view.kwargs.uuid initial.statut as initial_status_url %}
36+
{% url personal_data_base_url view.kwargs.uuid 'GEST_EN_COURS' as ongoing_status_url %}
3537
{% url personal_data_base_url view.kwargs.uuid 'GEST_BLOCAGE' as blocking_status_url %}
3638
{% url personal_data_base_url view.kwargs.uuid 'GEST_REUSSITE' as success_status_url %}
3739
{% translate initial.libelle as initial_state_label %}
3840
{% checklist_state_button tab='donnees_personnelles' label=initial_state_label icon='user' state=initial.statut class='muted' htmx_post=initial_status_url %}
3941
{% 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 %}
42+
{% checklist_state_button tab='donnees_personnelles' label=_("Expert opinion") icon='pencil' state='GEST_EN_COURS' class='warning' htmx_post=ongoing_status_url %}
4043
{% checklist_state_button tab='donnees_personnelles' label=_("Fraudster") icon='circle-stop' state='GEST_BLOCAGE' class='danger' fraud='1' htmx_post=blocking_status_url %}
4144
{% checklist_state_button tab='donnees_personnelles' label=_("Validated") icon='check' state='GEST_REUSSITE' class='success' htmx_post=success_status_url %}
4245
</div>
4346
{% if request.htmx %}
4447
{# Update the checklist menu item status #}
4548
{% include "admission/general_education/checklist_menu_item_status.html" with statut=current.statut item_name='donnees_personnelles' %}
49+
4650
{# Update the sic decision statuses #}
4751
{% if view.is_doctorate %}
4852
{% 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)