fixed request context for recipe serializer on import

This commit is contained in:
vabene1111
2021-01-12 21:40:14 +01:00
parent 068a09e28e
commit ea2f493e01
2 changed files with 2 additions and 2 deletions

View File

@ -188,7 +188,7 @@ class RecipeSerializer(WritableNestedModelSerializer):
read_only_fields = ['image', 'created_by', 'created_at']
def create(self, validated_data):
validated_data['created_by'] = self.context['request']._user
validated_data['created_by'] = self.context['request'].user
return super().create(validated_data)