diff --git a/api/meals.py b/api/meals.py index fc05eca..dee7ea5 100644 --- a/api/meals.py +++ b/api/meals.py @@ -241,7 +241,9 @@ async def create_meal_scoped( getattr(ing, "product_id", None) is not None and getattr(ing, "product_id") >= 0 ) if not has_product and name == "" and line == "": - return error_response(request, 400, "Ingredient must include a name or line or a product") + return error_response( + request, 400, "Ingredient must include a name or line or a product" + ) # quantity must be > 0 try: q = float(getattr(ing, "quantity", 0)) @@ -392,7 +394,9 @@ async def update_meal_scoped( getattr(ing, "product_id", None) is not None and getattr(ing, "product_id") >= 0 ) if not has_product and name == "" and line == "": - return error_response(request, 400, "Ingredient must include a name or line or a product") + return error_response( + request, 400, "Ingredient must include a name or line or a product" + ) try: q = float(getattr(ing, "quantity", 0)) except Exception: diff --git a/tests/test_recipes_ingredients_loaded_v2.py b/tests/test_recipes_ingredients_loaded_v2.py index 43aa2be..bde6d77 100644 --- a/tests/test_recipes_ingredients_loaded_v2.py +++ b/tests/test_recipes_ingredients_loaded_v2.py @@ -71,9 +71,7 @@ class TestRecipeIngredientsLoadedV2(unittest.IsolatedAsyncioTestCase): def test_get_by_id_includes_ingredients(self): rid, expected = self._create_recipe() - g = self.client.get( - f"/api/v1/households/{self.slug}/recipes/{rid}", headers=self.headers - ) + g = self.client.get(f"/api/v1/households/{self.slug}/recipes/{rid}", headers=self.headers) assert g.status_code == 200, g.text body = g.json() ings = body.get("ingredients", []) @@ -83,9 +81,7 @@ class TestRecipeIngredientsLoadedV2(unittest.IsolatedAsyncioTestCase): def test_list_includes_ingredients(self): rid, expected = self._create_recipe() - lst = self.client.get( - f"/api/v1/households/{self.slug}/recipes", headers=self.headers - ) + lst = self.client.get(f"/api/v1/households/{self.slug}/recipes", headers=self.headers) assert lst.status_code == 200, lst.text items = lst.json().get("items", []) # Find our recipe