Skip to content

Commit

Permalink
Merge pull request #4 from ZebraHr/develop
Browse files Browse the repository at this point in the history
правки после ревью
  • Loading branch information
ZebraHr authored Sep 28, 2023
2 parents ecc46a1 + d565aa3 commit 6458fc4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions backend/api/filters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django_filters.rest_framework import filters, FilterSet

from recipes.models import Recipe, Ingredient
from users.models import User

Expand Down
5 changes: 0 additions & 5 deletions backend/api/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,3 @@ def has_permission(self, request, view):
or (
request.user.is_authenticated
and (request.user.is_admin or request.user.is_superuser)))

# class IsAdminOrReadOnly(BasePermission):
# def has_permission(self, request, view):
# return (request.method in SAFE_METHODS
# or request.user and request.user.is_staff)
1 change: 0 additions & 1 deletion backend/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ class RecipeCreateSerializer(serializers.ModelSerializer):
many=True
)
cooking_time = serializers.IntegerField(
read_only=True,
min_value=settings.MIN_VALUE,
max_value=settings.MAX_VALUE)

Expand Down
2 changes: 1 addition & 1 deletion backend/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def download_shopping_cart(self, request):
amount=Sum('amount'))
shopping_list = ([f'{i["ingredient__name"]}'
f' - {i["amount"]}'
f' ({i["ingredient__measurement_unit"]}'
f' {i["ingredient__measurement_unit"]}'
for i in ingredients])
text = canvas.Canvas(buffer)
font = ttfonts.TTFont('Arial', './docs/arialfont.ttf')
Expand Down

0 comments on commit 6458fc4

Please sign in to comment.