From 68ca5d251cc9149611721614897035e7c0e65717 Mon Sep 17 00:00:00 2001 From: kovacspe Date: Sun, 12 Nov 2023 14:14:07 +0100 Subject: [PATCH] fix handling other school --- user/serializers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user/serializers.py b/user/serializers.py index a01ae106..a6f9d5be 100644 --- a/user/serializers.py +++ b/user/serializers.py @@ -126,8 +126,8 @@ def update(self, instance, validated_data): # User sa nikdy neupdatuje preto nie je potrebné volať instance.save() instance.profile.save() instance.save() - self.handle_other_school(validated_data.pop( - 'new_school_description', None)) + self.handle_other_school(profile_data.pop( + 'school', None)) return instance def handle_other_school(self, school): @@ -137,7 +137,7 @@ def handle_other_school(self, school): if school is None: return if school.code == self.OTHER_SCHOOL_CODE: - email = self.validated_data['email'] + email = self.validated_data.get('email', '-') first_name = self.validated_data['profile']['first_name'] last_name = self.validated_data['profile']['last_name'] school_info = self.validated_data['new_school_description']