From 2f1e9a12fa0dc4c5238a92b9b3fecc4da7557529 Mon Sep 17 00:00:00 2001 From: Samuel Gaist <samuel.gaist@idiap.ch> Date: Thu, 23 Aug 2018 11:45:09 +0200 Subject: [PATCH] [plotters][serializers] Add missing context on serializer creation The FullPlotterSerializer created within FullPlotterParameterSerializer was not getting any context so it could not perform proper checks regarding the user that made the request. --- beat/web/plotters/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beat/web/plotters/serializers.py b/beat/web/plotters/serializers.py index a3b0cb78f..e16fc70cf 100644 --- a/beat/web/plotters/serializers.py +++ b/beat/web/plotters/serializers.py @@ -226,7 +226,7 @@ class FullPlotterParameterSerializer(PlotterParameterAllSerializer): serializer = FullPlotterSerializer results = {} for plotter in all_plotters.iterator(): - serializer = FullPlotterSerializer(plotter, fields=['id', 'accessibility', 'modifiable', 'deletable', 'is_owner', 'name', 'fork_of', 'last_version', 'previous_version', 'short_description', 'description', 'version', 'creation_date', 'data', 'sample_data', 'declaration']) + serializer = FullPlotterSerializer(plotter, context=self.context, fields=['id', 'accessibility', 'modifiable', 'deletable', 'is_owner', 'name', 'fork_of', 'last_version', 'previous_version', 'short_description', 'description', 'version', 'creation_date', 'data', 'sample_data', 'declaration']) results[plotter.fullname()] = serializer.data return results -- GitLab