mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-28 23:43:22 +00:00
feat: Ajout de la sélection des modes de paiements / refactoring de
l'automate
This commit is contained in:
@ -1,68 +1,79 @@
|
||||
{
|
||||
"states": [
|
||||
"ABSENT",
|
||||
"CREE",
|
||||
"ENVOYE",
|
||||
"EN_VALIDATION",
|
||||
"A_RELANCER",
|
||||
"VALIDE",
|
||||
"ARCHIVE"
|
||||
"IDLE",
|
||||
"INITIALIZED",
|
||||
"SENT",
|
||||
"UNDER_REVIEW",
|
||||
"TO_BE_FOLLOWED_UP",
|
||||
"VALIDATED",
|
||||
"ARCHIVED",
|
||||
"SEPA_SENT"
|
||||
],
|
||||
"transitions": [
|
||||
{
|
||||
"name": "creationDI",
|
||||
"from": "ABSENT",
|
||||
"to": "CREE"
|
||||
"name": "EVENT_INIT",
|
||||
"from": "IDLE",
|
||||
"to": "INITIALIZED"
|
||||
},
|
||||
{
|
||||
"name": "envoiDI",
|
||||
"from": "CREE",
|
||||
"to": "ENVOYE"
|
||||
"name": "EVENT_SEND",
|
||||
"from": "INITIALIZED",
|
||||
"to": "SENT"
|
||||
},
|
||||
{
|
||||
"name": "archiveDI",
|
||||
"from": "CREE",
|
||||
"to": "ARCHIVE"
|
||||
"name": "EVENT_ARCHIVE",
|
||||
"from": "INITIALIZED",
|
||||
"to": "ARCHIVED"
|
||||
},
|
||||
{
|
||||
"name": "saisiDI",
|
||||
"from": "ENVOYE",
|
||||
"to": "EN_VALIDATION"
|
||||
"name": "EVENT_SIGNATURE",
|
||||
"from": "SENT",
|
||||
"to": "UNDER_REVIEW"
|
||||
},
|
||||
{
|
||||
"name": "relanceDI",
|
||||
"from": "ENVOYE",
|
||||
"to": "A_RELANCER"
|
||||
"name": "EVENT_FOLLOW_UP",
|
||||
"from": "SENT",
|
||||
"to": "TO_BE_FOLLOWED_UP"
|
||||
},
|
||||
{
|
||||
"name": "archiveDI",
|
||||
"from": "A_RELANCER",
|
||||
"to": "ARCHIVE"
|
||||
"name": "EVENT_ARCHIVE",
|
||||
"from": "SENT",
|
||||
"to": "ARCHIVED"
|
||||
},
|
||||
{
|
||||
"name": "archiveDI",
|
||||
"from": "ENVOYE",
|
||||
"to": "ARCHIVE"
|
||||
"name": "EVENT_ARCHIVE",
|
||||
"from": "TO_BE_FOLLOWED_UP",
|
||||
"to": "ARCHIVED"
|
||||
},
|
||||
{
|
||||
"name": "refuseDI",
|
||||
"from": "EN_VALIDATION",
|
||||
"to": "ENVOYE"
|
||||
"name": "EVENT_REFUSE",
|
||||
"from": "UNDER_REVIEW",
|
||||
"to": "SENT"
|
||||
},
|
||||
{
|
||||
"name": "valideDI",
|
||||
"from": "EN_VALIDATION",
|
||||
"to": "VALIDE"
|
||||
"name": "EVENT_VALIDATE",
|
||||
"from": "UNDER_REVIEW",
|
||||
"to": "VALIDATED"
|
||||
},
|
||||
{
|
||||
"name": "archiveDI",
|
||||
"from": "EN_VALIDATION",
|
||||
"to": "ARCHIVE"
|
||||
"name": "EVENT_SEND_SEPA",
|
||||
"from": "UNDER_REVIEW",
|
||||
"to": "SEPA_SENT"
|
||||
},
|
||||
{
|
||||
"name": "archiveDI",
|
||||
"from": "VALIDE",
|
||||
"to": "ARCHIVE"
|
||||
"name": "EVENT_ARCHIVE",
|
||||
"from": "UNDER_REVIEW",
|
||||
"to": "ARCHIVED"
|
||||
},
|
||||
{
|
||||
"name": "EVENT_SIGNATURE_SEPA",
|
||||
"from": "SEPA_SENT",
|
||||
"to": "UNDER_REVIEW"
|
||||
},
|
||||
{
|
||||
"name": "EVENT_ARCHIVE",
|
||||
"from": "VALIDATED",
|
||||
"to": "ARCHIVED"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -3,13 +3,14 @@ import json
|
||||
from Subscriptions.models import RegistrationForm
|
||||
|
||||
state_mapping = {
|
||||
"ABSENT": RegistrationForm.RegistrationFormStatus.RF_ABSENT,
|
||||
"CREE": RegistrationForm.RegistrationFormStatus.RF_CREATED,
|
||||
"ENVOYE": RegistrationForm.RegistrationFormStatus.RF_SENT,
|
||||
"EN_VALIDATION": RegistrationForm.RegistrationFormStatus.RF_UNDER_REVIEW,
|
||||
"A_RELANCER": RegistrationForm.RegistrationFormStatus.RF_TO_BE_FOLLOWED_UP,
|
||||
"VALIDE": RegistrationForm.RegistrationFormStatus.RF_VALIDATED,
|
||||
"ARCHIVE": RegistrationForm.RegistrationFormStatus.RF_ARCHIVED
|
||||
"IDLE": RegistrationForm.RegistrationFormStatus.RF_IDLE,
|
||||
"INITIALIZED": RegistrationForm.RegistrationFormStatus.RF_INITIALIZED,
|
||||
"SENT": RegistrationForm.RegistrationFormStatus.RF_SENT,
|
||||
"UNDER_REVIEW": RegistrationForm.RegistrationFormStatus.RF_UNDER_REVIEW,
|
||||
"TO_BE_FOLLOWED_UP": RegistrationForm.RegistrationFormStatus.RF_TO_BE_FOLLOWED_UP,
|
||||
"VALIDATED": RegistrationForm.RegistrationFormStatus.RF_VALIDATED,
|
||||
"ARCHIVED": RegistrationForm.RegistrationFormStatus.RF_ARCHIVED,
|
||||
"SEPA_SENT": RegistrationForm.RegistrationFormStatus.RF_SEPA_SENT
|
||||
}
|
||||
|
||||
def load_config(config_file):
|
||||
|
||||
@ -65,7 +65,7 @@ def envoieRelanceDossierInscription(recipients, code):
|
||||
return errorMessage
|
||||
|
||||
def isValid(message, fiche_inscription):
|
||||
# Est-ce que la référence du dossier est VALIDE
|
||||
# Est-ce que la référence du dossier est VALIDATED
|
||||
subject = message.subject
|
||||
print ("++++ " + subject)
|
||||
responsableMail = message.from_header
|
||||
|
||||
@ -3,7 +3,7 @@ from django.utils.timezone import now
|
||||
from django.conf import settings
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from School.models import SchoolClass, Fee, Discount
|
||||
from School.models import SchoolClass, Fee, Discount, PaymentModeType
|
||||
from Auth.models import ProfileRole
|
||||
from Establishment.models import Establishment
|
||||
|
||||
@ -62,11 +62,6 @@ class Student(models.Model):
|
||||
MS = 3, _('MS - Moyenne Section')
|
||||
GS = 4, _('GS - Grande Section')
|
||||
|
||||
class PaymentMethod(models.IntegerChoices):
|
||||
NONE = 0, _('Sélection du mode de paiement')
|
||||
SEPA_DIRECT_DEBIT = 1, _('Prélèvement SEPA')
|
||||
CHECK = 2, _('Chèques')
|
||||
|
||||
last_name = models.CharField(max_length=200, default="")
|
||||
first_name = models.CharField(max_length=200, default="")
|
||||
gender = models.IntegerField(choices=StudentGender, default=StudentGender.NONE, blank=True)
|
||||
@ -77,7 +72,6 @@ class Student(models.Model):
|
||||
birth_place = models.CharField(max_length=200, default="", blank=True)
|
||||
birth_postal_code = models.IntegerField(default=0, blank=True)
|
||||
attending_physician = models.CharField(max_length=200, default="", blank=True)
|
||||
payment_method = models.IntegerField(choices=PaymentMethod, default=PaymentMethod.NONE, blank=True)
|
||||
|
||||
# Many-to-Many Relationship
|
||||
profiles = models.ManyToManyField('Auth.Profile', blank=True)
|
||||
@ -184,17 +178,18 @@ class RegistrationTemplateMaster(models.Model):
|
||||
|
||||
class RegistrationForm(models.Model):
|
||||
class RegistrationFormStatus(models.IntegerChoices):
|
||||
RF_ABSENT = 0, _('Pas de dossier d\'inscription')
|
||||
RF_CREATED = 1, _('Dossier d\'inscription créé')
|
||||
RF_IDLE = 0, _('Pas de dossier d\'inscription')
|
||||
RF_INITIALIZED = 1, _('Dossier d\'inscription initialisé')
|
||||
RF_SENT = 2, _('Dossier d\'inscription envoyé')
|
||||
RF_UNDER_REVIEW = 3, _('Dossier d\'inscription en cours de validation')
|
||||
RF_TO_BE_FOLLOWED_UP = 4, _('Dossier d\'inscription à relancer')
|
||||
RF_VALIDATED = 5, _('Dossier d\'inscription validé')
|
||||
RF_ARCHIVED = 6, _('Dossier d\'inscription archivé')
|
||||
RF_SEPA_SENT = 7, _('Mandat SEPA envoyé')
|
||||
|
||||
# One-to-One Relationship
|
||||
student = models.OneToOneField(Student, on_delete=models.CASCADE, primary_key=True)
|
||||
status = models.IntegerField(choices=RegistrationFormStatus, default=RegistrationFormStatus.RF_ABSENT)
|
||||
status = models.IntegerField(choices=RegistrationFormStatus, default=RegistrationFormStatus.RF_IDLE)
|
||||
last_update = models.DateTimeField(auto_now=True)
|
||||
notes = models.CharField(max_length=200, blank=True)
|
||||
registration_link_code = models.CharField(max_length=200, default="", blank=True)
|
||||
@ -217,6 +212,8 @@ class RegistrationForm(models.Model):
|
||||
blank=True)
|
||||
|
||||
establishment = models.ForeignKey(Establishment, on_delete=models.CASCADE, related_name='register_forms')
|
||||
registration_payment = models.IntegerField(choices=PaymentModeType.choices, null=True, blank=True)
|
||||
tuition_payment = models.IntegerField(choices=PaymentModeType.choices, null=True, blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return "RF_" + self.student.last_name + "_" + self.student.first_name
|
||||
|
||||
@ -221,8 +221,8 @@ class RegistrationFormSerializer(serializers.ModelSerializer):
|
||||
|
||||
def update(self, instance, validated_data):
|
||||
student_data = validated_data.pop('student', None)
|
||||
fees_data = validated_data.pop('fees', [])
|
||||
discounts_data = validated_data.pop('discounts', [])
|
||||
fees_data = validated_data.pop('fees', None)
|
||||
discounts_data = validated_data.pop('discounts', None)
|
||||
if student_data:
|
||||
student = instance.student
|
||||
StudentSerializer.update(StudentSerializer(), student, student_data)
|
||||
@ -235,8 +235,11 @@ class RegistrationFormSerializer(serializers.ModelSerializer):
|
||||
instance.save()
|
||||
|
||||
# Associer les IDs des objets Fee et Discount au RegistrationForm
|
||||
instance.fees.set([fee.id for fee in fees_data])
|
||||
instance.discounts.set([discount.id for discount in discounts_data])
|
||||
if fees_data is not None:
|
||||
instance.fees.set([fee.id for fee in fees_data])
|
||||
|
||||
if discounts_data is not None:
|
||||
instance.discounts.set([discount.id for discount in discounts_data])
|
||||
|
||||
return instance
|
||||
|
||||
|
||||
@ -21,10 +21,10 @@ def check_for_signature_deadlines():
|
||||
send_notification(dossier)
|
||||
|
||||
def send_notification(dossier):
|
||||
logger.debug(f'Dossier en attente.... {dossier} - Positionnement à l\'état A_RELANCER')
|
||||
logger.debug(f'Dossier en attente.... {dossier} - Positionnement à l\'état TO_BE_FOLLOWED_UP')
|
||||
|
||||
# Changer l'état de l'automate
|
||||
updateStateMachine(dossier, 'relanceDI')
|
||||
updateStateMachine(dossier, 'EVENT_FOLLOW_UP')
|
||||
|
||||
url = settings.URL_DJANGO + 'GestionMessagerie/message'
|
||||
|
||||
|
||||
@ -194,8 +194,13 @@
|
||||
|
||||
<div class="section">
|
||||
<h2 class="section-title">MODALITÉS DE PAIEMENT</h2>
|
||||
{% with paymentMethod=student|getStudentPaymentMethod %}
|
||||
<p>{{ paymentMethod }}</p>
|
||||
<h3 class="subsection-title">Frais d'inscription</h3>
|
||||
{% with registrationPayment=student|getRegistrationPaymentMethod %}
|
||||
<p>{{ registrationPayment }}</p>
|
||||
{% endwith %}
|
||||
<h3 class="subsection-title">Frais de scolarité</h3>
|
||||
{% with tuitionPayment=student|getTuitionPaymentMethod %}
|
||||
<p>{{ tuitionPayment }}</p>
|
||||
{% endwith %}
|
||||
</div>
|
||||
|
||||
|
||||
@ -1,11 +1,17 @@
|
||||
from Subscriptions.models import RegistrationForm, Student
|
||||
from School.models import PaymentModeType
|
||||
from django import template
|
||||
register = template.Library()
|
||||
|
||||
@register.filter
|
||||
def getStudentPaymentMethod(pk):
|
||||
def getRegistrationPaymentMethod(pk):
|
||||
registerForm = RegistrationForm.objects.get(student=pk)
|
||||
return Student.PaymentMethod(int(registerForm.student.payment_method)).label
|
||||
return PaymentModeType(registerForm.registration_payment).label
|
||||
|
||||
@register.filter
|
||||
def getTuitionPaymentMethod(pk):
|
||||
registerForm = RegistrationForm.objects.get(student=pk)
|
||||
return PaymentModeType(registerForm.tuition_payment).label
|
||||
|
||||
@register.filter
|
||||
def getStudentLevel(pk):
|
||||
|
||||
@ -93,42 +93,35 @@ def getArgFromRequest(_argument, _request):
|
||||
resultat = data[_argument]
|
||||
return resultat
|
||||
|
||||
def merge_files_pdf(filenames, output_filename):
|
||||
from io import BytesIO
|
||||
from PyPDF2 import PdfMerger
|
||||
|
||||
def merge_files_pdf(file_paths):
|
||||
"""
|
||||
Fusionne plusieurs fichiers PDF en un seul document.
|
||||
Vérifie l'existence des fichiers sources avant la fusion.
|
||||
Fusionne plusieurs fichiers PDF et retourne le contenu fusionné en mémoire.
|
||||
"""
|
||||
merger = PdfMerger()
|
||||
valid_files = []
|
||||
|
||||
# Vérifier l'existence des fichiers et ne garder que ceux qui existent
|
||||
print(f'filenames : {filenames}')
|
||||
for filename in filenames:
|
||||
print(f'check exists filename : {filename}')
|
||||
if os.path.exists(filename):
|
||||
print(f'append filename : {filename}')
|
||||
valid_files.append(filename)
|
||||
|
||||
if not valid_files:
|
||||
raise FileNotFoundError("Aucun fichier valide à fusionner.")
|
||||
|
||||
# Ajouter les fichiers valides au merger
|
||||
for filename in valid_files:
|
||||
merger.append(filename)
|
||||
for file_path in file_paths:
|
||||
merger.append(file_path)
|
||||
|
||||
# S'assurer que le dossier de destination existe
|
||||
os.makedirs(os.path.dirname(output_filename), exist_ok=True)
|
||||
|
||||
# Sauvegarder le fichier fusionné
|
||||
merger.write(output_filename)
|
||||
# Sauvegarder le fichier fusionné en mémoire
|
||||
merged_pdf = BytesIO()
|
||||
merger.write(merged_pdf)
|
||||
merger.close()
|
||||
|
||||
return output_filename
|
||||
# Revenir au début du fichier en mémoire
|
||||
merged_pdf.seek(0)
|
||||
|
||||
return merged_pdf
|
||||
|
||||
def rfToPDF(registerForm, filename):
|
||||
"""
|
||||
Génère le PDF d'un dossier d'inscription et l'associe au RegistrationForm.
|
||||
"""
|
||||
filename = filename.replace(" ", "_")
|
||||
|
||||
data = {
|
||||
'pdf_title': f"Dossier d'inscription de {registerForm.student.first_name}",
|
||||
'signatureDate': convertToStr(_now(), '%d-%m-%Y'),
|
||||
@ -136,9 +129,6 @@ def rfToPDF(registerForm, filename):
|
||||
'student': registerForm.student,
|
||||
}
|
||||
|
||||
# S'assurer que le dossier parent existe
|
||||
os.makedirs(os.path.dirname(filename), exist_ok=True)
|
||||
|
||||
# Générer le PDF
|
||||
pdf = renderers.render_to_pdf('pdfs/dossier_inscription.html', data)
|
||||
|
||||
@ -147,19 +137,14 @@ def rfToPDF(registerForm, filename):
|
||||
os.remove(registerForm.registration_file.path)
|
||||
registerForm.registration_file.delete(save=False)
|
||||
|
||||
# Écrire le fichier directement
|
||||
with open(filename, 'wb') as f:
|
||||
f.write(pdf.content)
|
||||
# Enregistrer directement le fichier dans le champ registration_file
|
||||
registerForm.registration_file.save(
|
||||
os.path.basename(filename),
|
||||
File(BytesIO(pdf.content)), # Utilisation de BytesIO pour éviter l'écriture sur le disque
|
||||
save=True
|
||||
)
|
||||
|
||||
# Mettre à jour le champ registration_file du registerForm
|
||||
with open(filename, 'rb') as f:
|
||||
registerForm.registration_file.save(
|
||||
os.path.basename(filename),
|
||||
File(f),
|
||||
save=True
|
||||
)
|
||||
|
||||
return filename
|
||||
return registerForm.registration_file.path
|
||||
|
||||
def delete_registration_files(registerForm):
|
||||
"""
|
||||
|
||||
@ -155,7 +155,7 @@ class RegisterFormView(APIView):
|
||||
di = registerForm_serializer.save()
|
||||
|
||||
# Mise à jour de l'automate
|
||||
updateStateMachine(di, 'creationDI')
|
||||
updateStateMachine(di, 'EVENT_INIT')
|
||||
|
||||
# Récupération du reponsable associé
|
||||
for guardianId in guardiansId:
|
||||
@ -231,14 +231,25 @@ class RegisterFormWithIdView(APIView):
|
||||
Modifie un dossier d'inscription donné.
|
||||
"""
|
||||
studentForm_data = JSONParser().parse(request)
|
||||
|
||||
_status = studentForm_data.pop('status', 0)
|
||||
studentForm_data["last_update"] = str(util.convertToStr(util._now(), '%d-%m-%Y %H:%M'))
|
||||
|
||||
# Récupérer le dossier d'inscription
|
||||
registerForm = bdd.getObject(_objectName=RegistrationForm, _columnName='student__id', _value=id)
|
||||
if not registerForm:
|
||||
return JsonResponse({"error": "Dossier d'inscription introuvable"}, status=status.HTTP_404_NOT_FOUND)
|
||||
|
||||
studentForm_serializer = RegistrationFormSerializer(registerForm, data=studentForm_data, partial=True)
|
||||
if studentForm_serializer.is_valid():
|
||||
studentForm_serializer.save()
|
||||
else:
|
||||
return JsonResponse(studentForm_serializer.errors, safe=False, status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
if _status == RegistrationForm.RegistrationFormStatus.RF_UNDER_REVIEW:
|
||||
try:
|
||||
# Génération de la fiche d'inscription au format PDF
|
||||
base_dir = f"registration_files/dossier_rf_{registerForm.pk}"
|
||||
base_dir = f"data/registration_files/dossier_rf_{registerForm.pk}"
|
||||
os.makedirs(base_dir, exist_ok=True)
|
||||
|
||||
# Fichier PDF initial
|
||||
@ -248,46 +259,32 @@ class RegisterFormWithIdView(APIView):
|
||||
|
||||
# Récupération des fichiers d'inscription
|
||||
fileNames = RegistrationTemplate.get_files_from_rf(registerForm.pk)
|
||||
|
||||
if registerForm.registration_file:
|
||||
fileNames.insert(0, registerForm.registration_file.path)
|
||||
fileNames.insert(0, registerForm.registration_file.path)
|
||||
|
||||
# Création du fichier PDF Fusionné
|
||||
merged_pdf = f"{base_dir}/dossier_complet_{registerForm.pk}.pdf"
|
||||
|
||||
util.merge_files_pdf(fileNames, merged_pdf)
|
||||
merged_pdf_content = util.merge_files_pdf(fileNames)
|
||||
|
||||
# Mise à jour du champ registration_file avec le fichier fusionné
|
||||
with open(merged_pdf, 'rb') as f:
|
||||
registerForm.registration_file.save(
|
||||
os.path.basename(merged_pdf),
|
||||
File(f),
|
||||
save=True
|
||||
)
|
||||
|
||||
registerForm.registration_file.save(
|
||||
f"dossier_complet_{registerForm.pk}.pdf",
|
||||
File(merged_pdf_content),
|
||||
save=True
|
||||
)
|
||||
# Mise à jour de l'automate
|
||||
updateStateMachine(registerForm, 'saisiDI')
|
||||
updateStateMachine(registerForm, 'EVENT_SIGNATURE')
|
||||
except Exception as e:
|
||||
return JsonResponse({'error': str(e)}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
|
||||
elif _status == RegistrationForm.RegistrationFormStatus.RF_VALIDATED:
|
||||
# L'école a validé le dossier d'inscription
|
||||
# Mise à jour de l'automate
|
||||
updateStateMachine(registerForm, 'valideDI')
|
||||
elif _status == RegistrationForm.RegistrationFormStatus.RF_SENT:
|
||||
# Vérifier si l'étape précédente était RF_UNDER_REVIEW
|
||||
if registerForm.status == RegistrationForm.RegistrationFormStatus.RF_UNDER_REVIEW:
|
||||
# Mise à jour de l'automate
|
||||
updateStateMachine(registerForm, 'refuseDI')
|
||||
|
||||
# Supprimer le fichier et le dossier associés
|
||||
elif _status == RegistrationForm.RegistrationFormStatus.RF_VALIDATED:
|
||||
updateStateMachine(registerForm, 'EVENT_VALIDATE')
|
||||
elif _status == RegistrationForm.RegistrationFormStatus.RF_SENT:
|
||||
if registerForm.status == RegistrationForm.RegistrationFormStatus.RF_UNDER_REVIEW:
|
||||
updateStateMachine(registerForm, 'EVENT_REFUSE')
|
||||
util.delete_registration_files(registerForm)
|
||||
|
||||
studentForm_serializer = RegistrationFormSerializer(registerForm, data=studentForm_data)
|
||||
if studentForm_serializer.is_valid():
|
||||
studentForm_serializer.save()
|
||||
return JsonResponse(studentForm_serializer.data, safe=False)
|
||||
|
||||
return JsonResponse(studentForm_serializer.errors, safe=False, status=status.HTTP_400_BAD_REQUEST)
|
||||
# Retourner les données mises à jour
|
||||
return JsonResponse(studentForm_serializer.data, safe=False)
|
||||
|
||||
@swagger_auto_schema(
|
||||
responses={204: 'No Content'},
|
||||
@ -334,7 +331,7 @@ def send(request,id):
|
||||
errorMessage = mailer.sendRegisterForm(email, register_form.establishment.pk)
|
||||
if errorMessage == '':
|
||||
register_form.last_update=util.convertToStr(util._now(), '%d-%m-%Y %H:%M')
|
||||
updateStateMachine(register_form, 'envoiDI')
|
||||
updateStateMachine(register_form, 'EVENT_SEND')
|
||||
return JsonResponse({"message": f"Le dossier d'inscription a bien été envoyé à l'addresse {email}"}, safe=False)
|
||||
return JsonResponse({"errorMessage":errorMessage}, safe=False, status=status.HTTP_400_BAD_REQUEST)
|
||||
return JsonResponse({"errorMessage":'Dossier d\'inscription non trouvé'}, safe=False, status=status.HTTP_404_NOT_FOUND)
|
||||
@ -356,7 +353,7 @@ def archive(request,id):
|
||||
register_form = bdd.getObject(_objectName=RegistrationForm, _columnName='student__id', _value=id)
|
||||
if register_form != None:
|
||||
register_form.last_update=util.convertToStr(util._now(), '%d-%m-%Y %H:%M')
|
||||
updateStateMachine(register_form, 'archiveDI')
|
||||
updateStateMachine(register_form, 'EVENT_ARCHIVE')
|
||||
return JsonResponse({"message": "Le dossier a été archivé avec succès"}, safe=False)
|
||||
return JsonResponse({"errorMessage":'Dossier d\'inscription non trouvé'}, safe=False, status=status.HTTP_404_NOT_FOUND)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user