mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
fix: Correction option fusion
This commit is contained in:
@ -6,6 +6,9 @@ from django.utils.translation import gettext_lazy as _
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import logging
|
||||||
|
|
||||||
|
logger = logging.getLogger("SubscriptionModels")
|
||||||
|
|
||||||
class Language(models.Model):
|
class Language(models.Model):
|
||||||
"""
|
"""
|
||||||
@ -394,7 +397,8 @@ class RegistrationParentFileTemplate(models.Model):
|
|||||||
registration_files = RegistrationParentFileTemplate.objects.filter(registration_form=register_form_id)
|
registration_files = RegistrationParentFileTemplate.objects.filter(registration_form=register_form_id)
|
||||||
filenames = []
|
filenames = []
|
||||||
for reg_file in registration_files:
|
for reg_file in registration_files:
|
||||||
filenames.append(reg_file.file.path)
|
if reg_file.file and hasattr(reg_file.file, 'path'):
|
||||||
|
filenames.append(reg_file.file.path)
|
||||||
return filenames
|
return filenames
|
||||||
|
|
||||||
class AbsenceMoment(models.IntegerChoices):
|
class AbsenceMoment(models.IntegerChoices):
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import logger from '@/utils/logger';
|
|||||||
import Loader from '@/components/Loader';
|
import Loader from '@/components/Loader';
|
||||||
import { useEstablishment } from '@/context/EstablishmentContext';
|
import { useEstablishment } from '@/context/EstablishmentContext';
|
||||||
import { FE_ADMIN_SUBSCRIPTIONS_URL } from '@/utils/Url';
|
import { FE_ADMIN_SUBSCRIPTIONS_URL } from '@/utils/Url';
|
||||||
|
import { useNotification } from '@/context/NotificationContext';
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
@ -30,6 +31,7 @@ export default function Page() {
|
|||||||
|
|
||||||
const csrfToken = useCsrfToken();
|
const csrfToken = useCsrfToken();
|
||||||
const { selectedEstablishmentId } = useEstablishment();
|
const { selectedEstablishmentId } = useEstablishment();
|
||||||
|
const { showNotification } = useNotification();
|
||||||
|
|
||||||
const requestErrorHandler = (err) => {
|
const requestErrorHandler = (err) => {
|
||||||
logger.error('Error fetching data:', err);
|
logger.error('Error fetching data:', err);
|
||||||
@ -63,11 +65,20 @@ export default function Page() {
|
|||||||
editRegisterForm(studentId, formData, csrfToken)
|
editRegisterForm(studentId, formData, csrfToken)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
logger.debug('RF mis à jour avec succès:', response);
|
logger.debug('RF mis à jour avec succès:', response);
|
||||||
|
showNotification(
|
||||||
|
'Le dossier d\'inscription a été validé avec succès',
|
||||||
|
'success',
|
||||||
|
'Succès'
|
||||||
|
);
|
||||||
router.push(FE_ADMIN_SUBSCRIPTIONS_URL);
|
router.push(FE_ADMIN_SUBSCRIPTIONS_URL);
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
// Logique supplémentaire après la mise à jour (par exemple, redirection ou notification)
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
showNotification(
|
||||||
|
"Erreur lors de la validation du dossier d'inscription",
|
||||||
|
'error',
|
||||||
|
'Erreur'
|
||||||
|
);
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
logger.error('Erreur lors de la mise à jour du RF:', error);
|
logger.error('Erreur lors de la mise à jour du RF:', error);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -81,14 +81,13 @@ export default function ValidateSubscription({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleAssignClass = () => {
|
const handleAssignClass = () => {
|
||||||
const fusionParam = mergeDocuments ? 'true' : 'false';
|
|
||||||
if (formData.associated_class) {
|
if (formData.associated_class) {
|
||||||
const data = {
|
const data = {
|
||||||
student: {
|
student: {
|
||||||
associated_class: formData.associated_class,
|
associated_class: formData.associated_class,
|
||||||
},
|
},
|
||||||
status: 5,
|
status: 5,
|
||||||
fusionParam: fusionParam,
|
fusionParam: mergeDocuments,
|
||||||
};
|
};
|
||||||
|
|
||||||
onAccept(data);
|
onAccept(data);
|
||||||
|
|||||||
Reference in New Issue
Block a user