Skip to content

Commit

Permalink
Merge pull request #271 from ZdruzenieSTROM/fix_school_update
Browse files Browse the repository at this point in the history
fix handling other school
  • Loading branch information
kovacspe authored Nov 12, 2023
2 parents e71c9de + 68ca5d2 commit 873a7c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions user/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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']
Expand Down

0 comments on commit 873a7c5

Please sign in to comment.