From 4980a42f92ba14886316bc1455134a25b8932d3c Mon Sep 17 00:00:00 2001 From: kovacspe Date: Fri, 10 Nov 2023 17:58:34 +0100 Subject: [PATCH] Format --- personal/serializers.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/personal/serializers.py b/personal/serializers.py index 89177100..68269a70 100644 --- a/personal/serializers.py +++ b/personal/serializers.py @@ -4,8 +4,6 @@ from competition.models import Grade from personal.models import County, District, Profile, School -#from competition.serializers import GradeSerializer - @ts_interface(context='personal') class CountySerializer(serializers.ModelSerializer): @@ -50,8 +48,8 @@ def get_verbose_name(self, obj): @ts_interface(context='personal') class ProfileSerializer(serializers.ModelSerializer): - #grade_info = GradeSerializer(many=True) - + # grade_info = GradeSerializer(many=True) + grade = serializers.IntegerField() grade_name = serializers.SerializerMethodField('get_grade_name') school = SchoolProfileSerializer(many=False, read_only=True) @@ -81,7 +79,7 @@ def get_is_student(self, obj): def get_has_school(self, obj): return obj.school != School.objects.get(pk=0) and obj.school != School.objects.get(pk=1) - + def get_grade_name(self, obj): return Grade.get_grade_by_year_of_graduation( year_of_graduation=obj.year_of_graduation @@ -108,7 +106,7 @@ def create(self, validated_data): year_of_graduation=grade.get_year_of_graduation_by_date(), phone=validated_data['phone'], parent_phone=validated_data['parent_phone'], - gdpr=validated_data['gdpr'], + gdpr=validated_data['gdpr'] )