Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [feature/OS-1307 => DEV] Déplacer le modèle Scholarship dans OSIS Référence #2320

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .isort.cfg
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repos:
files: \.(py|html)$
args: [ --multiline, --negate ]
exclude: '^(migrations/\w+|.*__init__).py'
entry: '2015\-2024'
entry: '2015\-2025'
language: pygrep

- id: diff-quality
Expand Down
109 changes: 48 additions & 61 deletions admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# The core business involves the administration of students, teachers,
# courses, programs and so on.
#
# Copyright (C) 2015-2024 Université catholique de Louvain (http://www.uclouvain.be)
# Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -33,10 +33,12 @@
from django.contrib.messages import info, warning
from django.contrib.postgres.fields import ArrayField
from django.db import models
from django.db.models import Q, Exists, OuterRef, F, Value, When, Case
from django.db.models import Case, Exists, F, OuterRef, Q, Value, When
from django.shortcuts import resolve_url
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _, pgettext, pgettext_lazy, ngettext, get_language
from django.utils.translation import get_language
from django.utils.translation import gettext_lazy as _
from django.utils.translation import ngettext, pgettext, pgettext_lazy
from django_admin_listfilter_dropdown.filters import RelatedDropdownFilter
from django_json_widget.widgets import JSONEditorWidget
from hijack.contrib.admin import HijackUserAdminMixin
Expand All @@ -51,45 +53,61 @@
from admission.auth.roles.promoter import Promoter
from admission.auth.roles.sceb import Sceb
from admission.auth.roles.sic_management import SicManagement
from admission.ddd.admission.doctorat.preparation.domain.model.enums import (
ChoixStatutPropositionDoctorale,
)
from admission.ddd.admission.doctorat.preparation.domain.model.statut_checklist import (
ORGANISATION_ONGLETS_CHECKLIST_POUR_LISTING,
)
from admission.ddd.admission.enums import CritereItemFormulaireFormation
from admission.ddd.admission.enums.statut import CHOIX_STATUT_TOUTE_PROPOSITION
from admission.ddd.admission.formation_continue.domain.model.enums import (
ChoixStatutPropositionContinue,
)
from admission.ddd.admission.formation_continue.domain.model.statut_checklist import (
ORGANISATION_ONGLETS_CHECKLIST as ORGANISATION_ONGLETS_CHECKLIST_CONTINUE,
)
from admission.ddd.admission.formation_generale.domain.model.enums import (
ChoixStatutPropositionGenerale,
)
from admission.ddd.admission.formation_generale.domain.model.statut_checklist import (
ORGANISATION_ONGLETS_CHECKLIST as ORGANISATION_ONGLETS_CHECKLIST_GENERALE,
)
from admission.forms.checklist_state_filter import ChecklistStateFilterField
from admission.models import (
Accounting,
AdmissionTask,
AdmissionViewer,
ContinuingEducationAdmission,
DiplomaticPost,
DoctorateAdmission,
GeneralEducationAdmission,
Scholarship,
Accounting,
DiplomaticPost,
)
from admission.models.base import BaseAdmission
from admission.models.categorized_free_document import CategorizedFreeDocument
from admission.models.checklist import (
RefusalReasonCategory,
RefusalReason,
AdditionalApprovalCondition,
FreeAdditionalApprovalCondition,
RefusalReason,
RefusalReasonCategory,
)
from admission.models.epc_injection import (
EPCInjection,
EPCInjectionStatus,
EPCInjectionType,
)
from admission.models.epc_injection import EPCInjection, EPCInjectionStatus, EPCInjectionType
from admission.models.form_item import AdmissionFormItem, AdmissionFormItemInstantiation
from admission.models.online_payment import OnlinePayment
from admission.models.working_list import WorkingList, ContinuingWorkingList, DoctorateWorkingList
from admission.ddd.admission.doctorat.preparation.domain.model.enums import ChoixStatutPropositionDoctorale
from admission.ddd.admission.enums import CritereItemFormulaireFormation
from admission.ddd.admission.enums.statut import CHOIX_STATUT_TOUTE_PROPOSITION
from admission.ddd.admission.formation_continue.domain.model.enums import ChoixStatutPropositionContinue
from admission.ddd.admission.formation_generale.domain.model.enums import ChoixStatutPropositionGenerale
from admission.ddd.admission.formation_generale.domain.model.statut_checklist import (
ORGANISATION_ONGLETS_CHECKLIST as ORGANISATION_ONGLETS_CHECKLIST_GENERALE,
)
from admission.ddd.admission.formation_continue.domain.model.statut_checklist import (
ORGANISATION_ONGLETS_CHECKLIST as ORGANISATION_ONGLETS_CHECKLIST_CONTINUE,
)
from admission.ddd.admission.doctorat.preparation.domain.model.statut_checklist import (
ORGANISATION_ONGLETS_CHECKLIST_POUR_LISTING,
from admission.models.working_list import (
ContinuingWorkingList,
DoctorateWorkingList,
WorkingList,
)
from admission.forms.checklist_state_filter import ChecklistStateFilterField
from admission.services.injection_epc.injection_dossier import InjectionEPCAdmission
from admission.tasks import bulk_create_digit_persons_tickets, injecter_signaletique_a_epc_task
from admission.tasks import (
bulk_create_digit_persons_tickets,
injecter_signaletique_a_epc_task,
)
from admission.views.mollie_webhook import MollieWebHook
from base.models.academic_year import AcademicYear
from base.models.education_group_type import EducationGroupType
Expand All @@ -103,7 +121,6 @@
from osis_profile.models import EducationalExperience, ProfessionalExperience
from osis_role.contrib.admin import EntityRoleModelAdmin, RoleModelAdmin


# ##############################################################################
# Models

Expand Down Expand Up @@ -303,34 +320,6 @@ def trigger_payment_hook(self, request, queryset):
)


@admin.register(Scholarship)
class ScholarshipAdmin(admin.ModelAdmin):
list_display = [
'short_name',
'long_name',
'type',
'enabled',
]
search_fields = [
'short_name',
'long_name',
]
list_filter = [
'type',
'disabled',
]
fields = [
'type',
'short_name',
'long_name',
'disabled',
]

@admin.display(description=_('Enabled'), boolean=True)
def enabled(self, obj):
return not obj.disabled


FORM_ITEM_MIN_YEAR = 2022


Expand Down Expand Up @@ -667,15 +656,15 @@ def queryset(self, request, queryset):
| Q(
checklist__current__financabilite__status='GEST_REUSSITE',
checklist__current__financanbilite__extra__reussite='financable',
generaleducationadmission__financability_rule=''
generaleducationadmission__financability_rule='',
)
| Q(
checklist__current__financabilite__status='GEST_REUSSITE',
generaleducationadmission__financability_established_on__isnull=True
generaleducationadmission__financability_established_on__isnull=True,
)
| Q(
checklist__current__financabilite__status='GEST_REUSSITE',
generaleducationadmission__financability_established_by_id__isnull=True
generaleducationadmission__financability_established_by_id__isnull=True,
),
generaleducationadmission__isnull=False,
then=Value(False),
Expand Down Expand Up @@ -758,13 +747,10 @@ def get_queryset(self, request):
)
)

@admin.display(
ordering='_noma_sent_to_digit'
)
@admin.display(ordering='_noma_sent_to_digit')
def noma_sent_to_digit(self, obj):
return obj._noma_sent_to_digit


@admin.action(description='Injecter la demande dans EPC')
def injecter_dans_epc(self, request, queryset):
for demande in queryset.exclude(
Expand Down Expand Up @@ -922,6 +908,7 @@ def has_add_permission(self, request) -> bool:
def has_change_permission(self, request, obj=None) -> bool:
return False


# ##############################################################################
# Roles

Expand Down
4 changes: 2 additions & 2 deletions api/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# The core business involves the administration of students, teachers,
# courses, programs and so on.
#
# Copyright (C) 2015-2024 Université catholique de Louvain (http://www.uclouvain.be)
# Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -32,7 +32,7 @@
from backoffice.settings.rest_framework.fields import ActionLinksField
from base.models.utils.utils import ChoiceEnum

ADMISSION_SDK_VERSION = "1.0.110"
ADMISSION_SDK_VERSION = "1.0.113"


class AdmissionSchemaGenerator(SchemaGenerator):
Expand Down
69 changes: 34 additions & 35 deletions api/serializers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# The core business involves the administration of students, teachers,
# courses, programs and so on.
#
# Copyright (C) 2015-2024 Université catholique de Louvain (http://www.uclouvain.be)
# Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -24,51 +24,50 @@
#
# ##############################################################################

from .dashboard import DashboardSerializer
from .project import *
from .cotutelle import *
from .person import *
from .accounting import (
CompleterComptabilitePropositionDoctoraleCommandSerializer,
CompleterComptabilitePropositionGeneraleCommandSerializer,
DoctorateEducationAccountingDTOSerializer,
GeneralEducationAccountingDTOSerializer,
)
from .approvals import (
ApprouverPropositionCommandSerializer,
ApprouverPropositionParPdfCommandSerializer,
RefuserPropositionCommandSerializer,
)
from .campus import CampusSerializer
from .continuing_education import InformationsSpecifiquesFormationContinueDTOSerializer
from .coordonnees import CoordonneesSerializer
from .secondary_studies import HighSchoolDiplomaSerializer
from .languages_knowledge import *
from .supervision import *
from .cotutelle import *
from .curriculum import (
EducationalExperienceYearSerializer,
ContinuingEducationCompleterCurriculumCommandSerializer,
CurriculumDetailsSerializer,
ProfessionalExperienceSerializer,
DoctoratCompleterCurriculumCommandSerializer,
ContinuingEducationCompleterCurriculumCommandSerializer,
EducationalExperienceYearSerializer,
GeneralEducationCompleterCurriculumCommandSerializer,
ProfessionalExperienceSerializer,
)
from .approvals import (
ApprouverPropositionCommandSerializer,
RefuserPropositionCommandSerializer,
ApprouverPropositionParPdfCommandSerializer,
)
from .dashboard import DashboardSerializer
from .diplomatic_post import DiplomaticPostSerializer
from .doctorate import *
from .accounting import (
DoctorateEducationAccountingDTOSerializer,
GeneralEducationAccountingDTOSerializer,
CompleterComptabilitePropositionDoctoraleCommandSerializer,
CompleterComptabilitePropositionGeneraleCommandSerializer,
from .documents import *
from .languages_knowledge import *
from .payment import *
from .pdf_recap import PDFRecapSerializer
from .person import *
from .project import *
from .secondary_studies import HighSchoolDiplomaSerializer
from .specific_question import (
ModifierQuestionsSpecifiquesFormationContinueCommandSerializer,
ModifierQuestionsSpecifiquesFormationGeneraleCommandSerializer,
SpecificQuestionSerializer,
)
from .scholarship import ScholarshipSerializer
from .campus import CampusSerializer
from .submission import PropositionErrorsSerializer, SubmitPropositionSerializer
from .supervision import *
from .training_choice import (
InitierPropositionContinueCommandSerializer,
InitierPropositionGeneraleCommandSerializer,
ModifierChoixFormationContinueCommandSerializer,
ModifierTypeAdmissionDoctoraleCommandSerializer,
ModifierChoixFormationGeneraleCommandSerializer,
ModifierTypeAdmissionDoctoraleCommandSerializer,
)
from .specific_question import (
SpecificQuestionSerializer,
ModifierQuestionsSpecifiquesFormationGeneraleCommandSerializer,
ModifierQuestionsSpecifiquesFormationContinueCommandSerializer,
)
from .submission import PropositionErrorsSerializer, SubmitPropositionSerializer
from .pdf_recap import PDFRecapSerializer
from .documents import *
from .payment import *
from .diplomatic_post import DiplomaticPostSerializer
from .continuing_education import InformationsSpecifiquesFormationContinueDTOSerializer
39 changes: 0 additions & 39 deletions api/serializers/scholarship.py

This file was deleted.

7 changes: 3 additions & 4 deletions api/url_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# The core business involves the administration of students, teachers,
# courses, programs and so on.
#
# Copyright (C) 2015-2024 Université catholique de Louvain (http://www.uclouvain.be)
# Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -23,7 +23,8 @@
# see http://www.gnu.org/licenses/.
#
# ##############################################################################
from django.urls import include, path as _path
from django.urls import include
from django.urls import path as _path
from rest_framework.routers import SimpleRouter

import admission.api.views.submission
Expand Down Expand Up @@ -170,9 +171,7 @@ def path(pattern, view, name=None):
path('autocomplete/tutor', views.AutocompleteTutorView),
path('autocomplete/person', views.AutocompletePersonView),
path('autocomplete/diplomatic-post', views.AutocompleteDiplomaticPostView),
path('autocomplete/<str:scholarship_type>/scholarship', views.AutocompleteScholarshipView),
# Others
path('scholarship/<uuid:uuid>', views.RetrieveScholarshipView),
path('campus', views.ListCampusView),
path('campus/<uuid:uuid>', views.RetrieveCampusView),
path('diplomatic-post/<int:code>', views.RetrieveDiplomaticPostView),
Expand Down
Loading