Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
kovacspe committed Nov 10, 2023
1 parent 2d44a47 commit 4980a42
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions personal/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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']
)


Expand Down

0 comments on commit 4980a42

Please sign in to comment.