Skip to content

Commit 3268046

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 52b99b4 commit 3268046

File tree

13 files changed

+106
-55
lines changed

13 files changed

+106
-55
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +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
176+
est_fraudeur: bool
178177
non_financable: bool
179178
est_inscription_tardive: bool
180179

infrastructure/admission/formation_generale/repository/proposition.py

Lines changed: 10 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,17 @@ 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,
986+
non_financable=(
987+
checklist_actuelle['financabilite']['statut'] == ChoixStatutChecklist.GEST_BLOCAGE.name
988+
and checklist_actuelle['financabilite']['extra'].get('to_be_completed') == '0'
989+
) if checklist_actuelle else False,
984990
est_inscription_tardive=admission.late_enrollment,
985991
profil_soumis_candidat=(
986992
ProfilCandidatDTO.from_dict(

locale/en/LC_MESSAGES/django.po

Lines changed: 7 additions & 11 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
@@ -3013,15 +3013,9 @@ msgstr ""
30133013
msgid "Fraudster"
30143014
msgstr ""
30153015

3016-
msgid "Fraudster (ARES)"
3017-
msgstr ""
3018-
30193016
msgid "Fraudster status from ARES"
30203017
msgstr ""
30213018

3022-
msgid "Fraudster status from SIC"
3023-
msgstr ""
3024-
30253019
msgid "Free additional approval condition"
30263020
msgstr ""
30273021

@@ -4442,9 +4436,6 @@ msgstr ""
44424436
msgid "No enrolment application"
44434437
msgstr ""
44444438

4445-
msgid "No fraud identified"
4446-
msgstr ""
4447-
44484439
msgid "No general enrolment"
44494440
msgstr ""
44504441

@@ -5781,6 +5772,11 @@ msgstr ""
57815772
msgid "Sender"
57825773
msgstr ""
57835774

5775+
msgid ""
5776+
"Sending the authorization is impossible while the personal data are in the "
5777+
"\"Fraudster\" status."
5778+
msgstr ""
5779+
57845780
msgid "Sent to EPC"
57855781
msgstr ""
57865782

locale/fr_BE/LC_MESSAGES/django.po

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ 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> par l'ARES"
180180

181181
#, python-format
182182
msgid ""
@@ -3303,15 +3303,9 @@ msgstr "Ancien·ne étudiant·e UCLouvain"
33033303
msgid "Fraudster"
33043304
msgstr "Fraudeur"
33053305

3306-
msgid "Fraudster (ARES)"
3307-
msgstr "Fraudeur (ARES)"
3308-
33093306
msgid "Fraudster status from ARES"
33103307
msgstr "Statut fraudeur d'après l'ARES"
33113308

3312-
msgid "Fraudster status from SIC"
3313-
msgstr "Statut fraudeur d'après SIC"
3314-
33153309
msgid "Free additional approval condition"
33163310
msgstr "Condition complémentaire d'acceptation libre"
33173311

@@ -4948,9 +4942,6 @@ msgstr ""
49484942
msgid "No enrolment application"
49494943
msgstr "Aucune demande d'inscription n'a été trouvée"
49504944

4951-
msgid "No fraud identified"
4952-
msgstr "Pas de fraude identifiée"
4953-
49544945
msgid "No general enrolment"
49554946
msgstr "Aucune inscription en formation générale n'a été trouvée"
49564947

@@ -6364,6 +6355,11 @@ msgstr "Envoyer en faculté"
63646355
msgid "Sender"
63656356
msgstr "Expéditeur"
63666357

6358+
msgid ""
6359+
"Sending the authorization is impossible while the personal data are in the "
6360+
"\"Fraudster\" status."
6361+
msgstr "L’envoi de l’autorisation est impossible lorsque les données personnelles sont à l'état \"Fraudeur\"."
6362+
63676363
msgid "Sent to EPC"
63686364
msgstr "Envoyée à EPC"
63696365

templates/admission/general_education/checklist.html

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

439+
{% if autres_demandes %}
439440
<div class="info-part">
440-
{% include 'admission/general_education/includes/checklist/sic_decision_sic_fraud_status.html' %}
441441
<dl>
442-
<dt>{% trans "Fraudster status from ARES" %}</dt>
443-
<dd class="mb-15">
444-
Not implemented yet.
445-
</dd>
446-
447-
{% if autres_demandes %}
448442
<dt>{% trans "Other demand(s) by the candidate." %}</dt>
449443
<dd>
450444
{% include 'admission/includes/lite_admission_list.html' with with_title=True %}
451445
</dd>
452-
{% endif %}
453446
</dl>
454447
</div>
448+
{% endif %}
455449

456450
</div>
457451

@@ -1068,6 +1062,19 @@
10681062
htmx.trigger('#financabilite-computed-rule', 'financabiliteComputeRule');
10691063
});
10701064

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