Fix: comments in user serializer
This commit is contained in:
parent
c89f40aa1f
commit
14f9487919
1 changed files with 6 additions and 2 deletions
|
@ -30,9 +30,13 @@ class UserSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
# Update the UserProfile instance
|
# Update the UserProfile instance
|
||||||
if profile_data:
|
if profile_data:
|
||||||
userprofile_instance = instance.userprofile # The related UserProfile instance
|
userprofile_instance = (
|
||||||
|
instance.userprofile
|
||||||
|
) # The related UserProfile instance
|
||||||
profile_serializer = self.fields["profile"] # Get the nested serializer
|
profile_serializer = self.fields["profile"] # Get the nested serializer
|
||||||
profile_serializer.update(userprofile_instance, profile_data) # Update the UserProfile
|
profile_serializer.update(
|
||||||
|
userprofile_instance, profile_data
|
||||||
|
) # Update the UserProfile
|
||||||
|
|
||||||
# Update the User fields
|
# Update the User fields
|
||||||
for attr, value in validated_data.items():
|
for attr, value in validated_data.items():
|
||||||
|
|
Loading…
Add table
Reference in a new issue