Skip to content

Commit 873a7c5

Browse files
authored
Merge pull request #271 from ZdruzenieSTROM/fix_school_update
fix handling other school
2 parents e71c9de + 68ca5d2 commit 873a7c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

user/serializers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ def update(self, instance, validated_data):
126126
# User sa nikdy neupdatuje preto nie je potrebné volať instance.save()
127127
instance.profile.save()
128128
instance.save()
129-
self.handle_other_school(validated_data.pop(
130-
'new_school_description', None))
129+
self.handle_other_school(profile_data.pop(
130+
'school', None))
131131
return instance
132132

133133
def handle_other_school(self, school):
@@ -137,7 +137,7 @@ def handle_other_school(self, school):
137137
if school is None:
138138
return
139139
if school.code == self.OTHER_SCHOOL_CODE:
140-
email = self.validated_data['email']
140+
email = self.validated_data.get('email', '-')
141141
first_name = self.validated_data['profile']['first_name']
142142
last_name = self.validated_data['profile']['last_name']
143143
school_info = self.validated_data['new_school_description']

0 commit comments

Comments
 (0)