diff --git a/backend/api/serializers.py b/backend/api/serializers.py index 5a1d1d1..b0c4ab3 100644 --- a/backend/api/serializers.py +++ b/backend/api/serializers.py @@ -39,7 +39,7 @@ def get_is_subscribed(self, obj): request = self.context.get('request') if request is None or request.user.is_anonymous: return False - return obj.follower.exists() + return obj.following.filter(user=request.user).exists() class Meta: model = User diff --git a/backend/foodgram/settings.py b/backend/foodgram/settings.py index 2e16fa3..d05f5fd 100644 --- a/backend/foodgram/settings.py +++ b/backend/foodgram/settings.py @@ -73,7 +73,6 @@ MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') - # DATABASES = { # 'default': { # 'ENGINE': 'django.db.backends.sqlite3',