Fix: comments in user serializer

This commit is contained in:
Aroy-Art 2025-04-10 22:35:55 +02:00
parent c89f40aa1f
commit 14f9487919
Signed by: Aroy
GPG key ID: 583642324A1D2070

View file

@ -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():