From c5055f39665d1e52c09bef96742ba1a0e4dfd558 Mon Sep 17 00:00:00 2001 From: NAGGINDA MARTHA Date: Wed, 26 May 2021 05:06:09 -0400 Subject: [PATCH] - [Fixes #204]: Ceating a New GeoStory Displays a Network Error (#206) --- mapstore2_adapter/geoapps/geostories/api/serializers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mapstore2_adapter/geoapps/geostories/api/serializers.py b/mapstore2_adapter/geoapps/geostories/api/serializers.py index a7887435ee..1d2b1db2fd 100644 --- a/mapstore2_adapter/geoapps/geostories/api/serializers.py +++ b/mapstore2_adapter/geoapps/geostories/api/serializers.py @@ -84,6 +84,12 @@ def to_internal_value(self, data): return data + def validate(self, data): + request = self.context.get('request') + if request: + data['owner'] = request.user + return data + def create(self, validated_data): # Sanity checks if 'name' not in validated_data or \