mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-07 07:08:03 -05:00
fixed sub recipe issue
This commit is contained in:
@@ -475,7 +475,7 @@ class StepSerializer(WritableNestedModelSerializer, ExtendedRecipeMixin):
|
|||||||
# check if root type is recipe to prevent infinite recursion
|
# check if root type is recipe to prevent infinite recursion
|
||||||
# can be improved later to allow multi level embedding
|
# can be improved later to allow multi level embedding
|
||||||
if obj.step_recipe and type(self.parent.root) == RecipeSerializer:
|
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:
|
class Meta:
|
||||||
model = Step
|
model = Step
|
||||||
|
|||||||
Reference in New Issue
Block a user