Skip to content

Commit

Permalink
11
Browse files Browse the repository at this point in the history
  • Loading branch information
fabilya committed Oct 1, 2023
1 parent 31c6e4f commit 7739a00
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backend/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,12 @@ class RecipeViewSet(
queryset = Recipe.objects.all()
filter_backends = (DjangoFilterBackend,)
filterset_class = RecipeFilter
permission_classes = OwnerUserOrReadOnly

def get_permissions(self):

permissions_dict = {
'create': [permissions.IsAuthenticated()],
'partial_update': [OwnerUserOrReadOnly],
'partial_update': [OwnerUserOrReadOnly()],
'favorite': [permissions.IsAuthenticated()],
'shopping_cart': [permissions.IsAuthenticated()],
'download_shopping_cart': [permissions.IsAuthenticated()],
Expand Down Expand Up @@ -135,7 +134,7 @@ def download_shopping_cart(self, request):
).values(
'ingredient__name',
'ingredient__measurement_unit'
).annotate(cart_amount=Sum('ingredient__amount')).order_by()
).annotate(cart_amount=Sum('amount'))

today = datetime.today()
shopping_list = (
Expand Down

0 comments on commit 7739a00

Please sign in to comment.