From 3e5cebef44dd690d93dacecf08f3cf46d220b081 Mon Sep 17 00:00:00 2001 From: N3WT DE COMPET Date: Thu, 22 May 2025 19:08:40 +0200 Subject: [PATCH] =?UTF-8?q?chore:=20Suppression=20de=20champs=20requis=20l?= =?UTF-8?q?ors=20de=20la=20cr=C3=A9ation=20d'une=20classe=20(non=20obligat?= =?UTF-8?q?oire=20pour=20la=20tranche=20d'age=20par=20exemple)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Back-End/School/models.py | 4 ++-- .../components/Structure/Configuration/ClassesSection.js | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Back-End/School/models.py b/Back-End/School/models.py index 6975363..b9bffc8 100644 --- a/Back-End/School/models.py +++ b/Back-End/School/models.py @@ -44,8 +44,8 @@ class SchoolClass(models.Model): ] atmosphere_name = models.CharField(max_length=255, null=True, blank=True) - age_range = models.JSONField(blank=True) - number_of_students = models.PositiveIntegerField(blank=True) + age_range = models.JSONField(null=True, blank=True) + number_of_students = models.PositiveIntegerField(null=True, blank=True) teaching_language = models.CharField(max_length=255, blank=True) school_year = models.CharField(max_length=9, blank=True) updated_date = models.DateTimeField(auto_now=True) diff --git a/Front-End/src/components/Structure/Configuration/ClassesSection.js b/Front-End/src/components/Structure/Configuration/ClassesSection.js index aa3f6d9..71c24f0 100644 --- a/Front-End/src/components/Structure/Configuration/ClassesSection.js +++ b/Front-End/src/components/Structure/Configuration/ClassesSection.js @@ -168,7 +168,7 @@ const ClassesSection = ({ atmosphere_name: '', age_range: '', levels: [], - number_of_students: '', + number_of_students: null, school_year: '', teachers: [], establishment: selectedEstablishmentId, @@ -177,7 +177,7 @@ const ClassesSection = ({ atmosphere_name: '', age_range: '', levels: [], - number_of_students: '', + number_of_students: null, school_year: '', teachers: [], establishment: selectedEstablishmentId, @@ -203,9 +203,7 @@ const ClassesSection = ({ const handleSaveNewClass = () => { if ( newClass.atmosphere_name && - newClass.age_range && newClass.levels.length > 0 && - newClass.number_of_students && newClass.school_year ) { handleCreate(newClass) @@ -242,9 +240,7 @@ const ClassesSection = ({ const handleUpdateClass = (id, updatedData) => { if ( updatedData.atmosphere_name && - updatedData.age_range && updatedData.levels.length > 0 && - updatedData.number_of_students && updatedData.school_year ) { handleEdit(id, updatedData)