From af2088c4b7b616c947d877494d31180483b3b716 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Tue, 14 Nov 2023 18:37:15 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20li=C3=A9es=20=C3=A0=20la=20nouvell?= =?UTF-8?q?e=20section=20MSP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- candidats/models.py | 2 +- candidats/views.py | 4 ++-- common/settings.py | 2 +- stages/views/export.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/candidats/models.py b/candidats/models.py index 3a978c0..fd6bc17 100644 --- a/candidats/models.py +++ b/candidats/models.py @@ -16,7 +16,7 @@ SECTION_CHOICES = ( ('ASSC', 'Assist. en soin et santé communautaire CFC'), ('EDE', "Education de l’enfance, dipl. ES"), ('EDS', 'Education sociale, dipl. ES'), - ('MSP', "Maitrise socioprofessionnelle, dipl. ES"), + ('MSP', "Maîtrise socioprofessionnelle, dipl. ES"), ) OPTION_CHOICES = ( diff --git a/candidats/views.py b/candidats/views.py index 3b7232b..fce51da 100644 --- a/candidats/views.py +++ b/candidats/views.py @@ -36,7 +36,7 @@ class ConfirmationView(CandidateConfirmationView): def get(self, request, *args, **kwargs): candidate = Candidate.objects.get(pk=self.kwargs['pk']) - if candidate.section not in {'ASA', 'ASE', 'ASSC', 'EDE', 'EDS'}: + if candidate.section not in {'ASA', 'ASE', 'ASSC', 'EDE', 'EDS', 'MSP'}: messages.error(request, "Ce formulaire n'est disponible que pour les candidats FE ou ES") elif candidate.confirmation_date: messages.error(request, 'Une confirmation a déjà été envoyée!') @@ -51,7 +51,7 @@ class ConfirmationView(CandidateConfirmationView): candidate = Candidate.objects.get(pk=self.kwargs['pk']) to = [candidate.email] - if candidate.section == 'EDE': + if candidate.section in {'EDE', 'MSP'}: src_email = 'email/candidate_confirm_EDE.txt' elif candidate.section == 'EDS': src_email = 'email/candidate_confirm_EDS.txt' diff --git a/common/settings.py b/common/settings.py index 7bd2e0d..0ddaa81 100644 --- a/common/settings.py +++ b/common/settings.py @@ -73,11 +73,11 @@ TEMPLATES = [ # Insert your TEMPLATE_CONTEXT_PROCESSORS here or use this # list if you haven't customized them: 'django.contrib.auth.context_processors.auth', - 'django.template.context_processors.debug', 'django.template.context_processors.i18n', 'django.template.context_processors.media', 'django.template.context_processors.static', 'django.template.context_processors.tz', + 'django.template.context_processors.request', 'django.contrib.messages.context_processors.messages', ], }, diff --git a/stages/views/export.py b/stages/views/export.py index c5ae923..322552b 100644 --- a/stages/views/export.py +++ b/stages/views/export.py @@ -443,7 +443,7 @@ def export_qualification(request): # Data empty_values = [''] * 7 - es_classes = Klass.objects.filter(section__name__in=['EDS', 'EDE', 'MSP'], name__startswith='3') + es_classes = Klass.objects.filter(section__name__in=['EDS', 'EDE', 'MSP'], level__name='3') students = Student.objects.filter( klass__in=es_classes, archived=False ).select_related('klass', 'referent', 'training_referent', 'mentor',