Skip to content

Commit

Permalink
Исправлена работа подписок
Browse files Browse the repository at this point in the history
  • Loading branch information
VitalRu committed Sep 22, 2023
1 parent 00e4919 commit d5caf4b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion backend/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion backend/foodgram/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')


# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
Expand Down

0 comments on commit d5caf4b

Please sign in to comment.