From 6f2e137bf30f174a0a151d64e8983ab3faae2036 Mon Sep 17 00:00:00 2001 From: through-your-tears Date: Sat, 6 Apr 2024 12:27:23 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D1=81=D0=B5=D1=80?= =?UTF-8?q?=D0=B8=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=82=D0=BE=D1=80=D0=B0=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=BF=D1=80=D0=BE=D1=84=D0=B8=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jwtauth/serializers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/jwtauth/serializers.py b/src/jwtauth/serializers.py index 19fda9a..461dfc2 100644 --- a/src/jwtauth/serializers.py +++ b/src/jwtauth/serializers.py @@ -104,8 +104,8 @@ class CustomUserSerializer(serializers.ModelSerializer): class ProfileSerializer(serializers.ModelSerializer): user = serializers.StringRelatedField() - friends = serializers.SerializerMethodField(read_only=True) - subscribers = serializers.SerializerMethodField(read_only=True) + count_friends = serializers.SerializerMethodField(read_only=True) + count_subscribers = serializers.SerializerMethodField(read_only=True) def get_friends(self, obj): return obj.friends.filter(approved=True).count() @@ -115,4 +115,4 @@ class ProfileSerializer(serializers.ModelSerializer): class Meta: model = Profile - fields = ('user', 'first_name', 'last_name', 'title', 'avatar', 'friends', 'subscribers') + fields = ('user', 'first_name', 'last_name', 'title', 'avatar', 'count_friends', 'count_subscribers')