fix: Correct language retrieval in profile to use the provided object

This commit is contained in:
wangruidong
2025-06-16 18:57:11 +08:00
committed by w940853815
parent 17e8f25cb4
commit cfbd162890

View File

@@ -146,7 +146,7 @@ class UserProfileSerializer(UserSerializer):
return password
def get_lang(self, obj):
return getattr(self.instance, 'lang', settings.LANGUAGE_CODE)
return getattr(obj, 'lang', settings.LANGUAGE_CODE)
class UserPKUpdateSerializer(serializers.ModelSerializer):