Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix handling other school #271

Merged
merged 1 commit into from
Nov 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading