From 6a592c486455860a0471bda43fd3b5b944e207e5 Mon Sep 17 00:00:00 2001 From: through-your-tears Date: Sat, 6 Apr 2024 12:30:02 +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 461dfc2..785608b 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() - count_friends = serializers.SerializerMethodField(read_only=True) - count_subscribers = serializers.SerializerMethodField(read_only=True) + count_friends = serializers.SerializerMethodField(method_name='get_friends', read_only=True) + count_subscribers = serializers.SerializerMethodField(method_name='get_subscribers', read_only=True) def get_friends(self, obj): return obj.friends.filter(approved=True).count()