From dd42e8fb4f66713ff3258a1d13375fb6b66d9a3d Mon Sep 17 00:00:00 2001 From: through-your-tears Date: Sat, 6 Apr 2024 12:33:04 +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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jwtauth/serializers.py b/src/jwtauth/serializers.py index 785608b..f07bedb 100644 --- a/src/jwtauth/serializers.py +++ b/src/jwtauth/serializers.py @@ -108,10 +108,10 @@ class ProfileSerializer(serializers.ModelSerializer): count_subscribers = serializers.SerializerMethodField(method_name='get_subscribers', read_only=True) def get_friends(self, obj): - return obj.friends.filter(approved=True).count() + return obj.second_friend.filter(approved=True).count() + obj.first_friend.filter(approved=True).count() def get_subscribers(self, obj): - return obj.friends.filter(approved=False).count() + return obj.second_friend.filter(approved=False).count() class Meta: model = Profile