diff --git a/backend/api/user/management/commands/backfill_user_profiles.py b/backend/api/user/management/commands/backfill_user_profiles.py index 1fe7275..48237cd 100644 --- a/backend/api/user/management/commands/backfill_user_profiles.py +++ b/backend/api/user/management/commands/backfill_user_profiles.py @@ -1,7 +1,7 @@ # api/user/management/commands/backfill_user_profiles.py from django.core.management.base import BaseCommand from django.contrib.auth.models import User -from api.user.models import UserProfile # assuming you have a UserProfile model +from api.user.models import UserProfile class Command(BaseCommand): diff --git a/backend/api/user/serializers.py b/backend/api/user/serializers.py index 1c10d23..8dd9033 100644 --- a/backend/api/user/serializers.py +++ b/backend/api/user/serializers.py @@ -30,9 +30,13 @@ class UserSerializer(serializers.ModelSerializer): # Update the UserProfile instance 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.update(userprofile_instance, profile_data) # Update the UserProfile + profile_serializer.update( + userprofile_instance, profile_data + ) # Update the UserProfile # Update the User fields for attr, value in validated_data.items():