From 90b6f9ad06dde36ced99aac6b9c25e1a601021dd Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Mon, 17 Jan 2022 19:54:16 +0100 Subject: [PATCH] fixed sub recipe issue --- cookbook/serializer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/serializer.py b/cookbook/serializer.py index 06d09c216..ce8d48de9 100644 --- a/cookbook/serializer.py +++ b/cookbook/serializer.py @@ -475,7 +475,7 @@ class StepSerializer(WritableNestedModelSerializer, ExtendedRecipeMixin): # check if root type is recipe to prevent infinite recursion # can be improved later to allow multi level embedding if obj.step_recipe and type(self.parent.root) == RecipeSerializer: - return StepRecipeSerializer(obj.step_recipe).data + return StepRecipeSerializer(obj.step_recipe, context={'request': self.context['request']}).data class Meta: model = Step