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)