mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-28 23:43:22 +00:00
refactor: Refactoring de la section ClassSection
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
# The first instruction is what image we want to base our container on
|
||||
# We Use an official Python runtime as a parent image
|
||||
FROM python:3.12.7
|
||||
WORKDIR /Back-End
|
||||
|
||||
# Allows docker to cache installed dependencies between builds
|
||||
COPY requirements.txt requirements.txt
|
||||
@ -11,7 +12,6 @@ RUN pip install pymupdf
|
||||
|
||||
# Mounts the application code to the image
|
||||
COPY . .
|
||||
WORKDIR /Back-End
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
|
||||
@ -68,11 +68,7 @@ class TeacherSerializer(serializers.ModelSerializer):
|
||||
|
||||
def get_droit(self, obj):
|
||||
if obj.associated_profile:
|
||||
droit_id = obj.associated_profile.droit
|
||||
return {
|
||||
"label": obj.associated_profile.get_droit_display(),
|
||||
"id": droit_id
|
||||
}
|
||||
return obj.associated_profile.droit
|
||||
return None
|
||||
|
||||
def get_specialities_details(self, obj):
|
||||
@ -163,7 +159,7 @@ class SchoolClassSerializer(serializers.ModelSerializer):
|
||||
return instance
|
||||
|
||||
def get_teachers_details(self, obj):
|
||||
return [{'last_name': teacher.last_name, 'first_name': teacher.first_name} for teacher in obj.teachers.all()]
|
||||
return [{'id': teacher.id, 'last_name': teacher.last_name, 'first_name': teacher.first_name} for teacher in obj.teachers.all()]
|
||||
|
||||
def get_updated_date_formatted(self, obj):
|
||||
utc_time = timezone.localtime(obj.updated_date)
|
||||
|
||||
Reference in New Issue
Block a user