Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkjellid committed Jun 19, 2024
1 parent ef197ca commit 54fb474
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions nest/recipes/ingredients/services.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import functools

import structlog
from django.db import models, transaction
from django.db import transaction
from django.http import HttpRequest
from pydantic import BaseModel, Field

Expand Down Expand Up @@ -59,7 +59,7 @@ class IngredientGroupItem(BaseModel):

def _get_ingredient_item_group_id(
group_item: IngredientGroupItem,
recipe_groups: models.QuerySet[RecipeIngredientItemGroup],
recipe_groups: list[RecipeIngredientItemGroup],
) -> int:
return next(
g.id
Expand Down
8 changes: 3 additions & 5 deletions nest/recipes/steps/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from decimal import Decimal

import structlog
from django.db import models, transaction
from django.db import transaction
from pydantic import BaseModel

from nest.core.exceptions import ApplicationError
Expand Down Expand Up @@ -89,7 +89,7 @@ def create_or_update_recipe_steps(recipe_id: int, steps: list[Step]) -> None:

def _find_ingredient_item_id_for_step_item(
item: IngredientItem,
recipe_ingredient_items: models.QuerySet[RecipeIngredientItem],
recipe_ingredient_items: list[RecipeIngredientItem],
) -> int:
if item.id is not None:
return item.id
Expand All @@ -106,9 +106,7 @@ def _find_ingredient_item_id_for_step_item(
return item_id


def _find_step_id_for_step_item(
step: Step, recipe_steps: models.QuerySet[RecipeStep]
) -> int:
def _find_step_id_for_step_item(step: Step, recipe_steps: list[RecipeStep]) -> int:
if step.id is not None:
return step.id

Expand Down
1 change: 0 additions & 1 deletion tests/recipes/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from nest.recipes.steps.enums import RecipeStepType
from nest.recipes.steps.models import RecipeStep, RecipeStepIngredientItem


##########
# Recipe #
##########
Expand Down
2 changes: 0 additions & 2 deletions tests/recipes/test_ingredients_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
create_recipe_ingredient,
delete_recipe_ingredient,
)
from nest.recipes.steps.enums import RecipeStepType
from nest.recipes.steps.services import Step


@pytest.mark.product
Expand Down
4 changes: 2 additions & 2 deletions tests/recipes/test_steps_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from nest.recipes.steps.models import RecipeStep, RecipeStepIngredientItem
from nest.recipes.steps.services import (
Step,
create_or_update_recipe_steps,
_find_step_id_for_step_item,
_find_ingredient_item_id_for_step_item,
_find_step_id_for_step_item,
create_or_update_recipe_step_ingredient_items,
create_or_update_recipe_steps,
)


Expand Down

0 comments on commit 54fb474

Please sign in to comment.