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:
@ -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