From 88b7b05dafdb2861d82e62ae49f0edca86dcbe98 Mon Sep 17 00:00:00 2001 From: Samuel Gaist <samuel.gaist@idiap.ch> Date: Thu, 23 Aug 2018 15:20:55 +0200 Subject: [PATCH] [plotters][serializers] Add explicit data json field This allows the PlotterParameterCreationSerializer to properly handle the json given as data parameter. --- 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 e16fc70cf..6a8d5cb26 100644 --- a/beat/web/plotters/serializers.py +++ b/beat/web/plotters/serializers.py @@ -112,6 +112,7 @@ class PlotterParameterCreationFailedException(Exception): pass class PlotterParameterCreationSerializer(ContributionCreationSerializer): + data = serializers.JSONField(required=False) class Meta(ContributionCreationSerializer.Meta): model = PlotterParameter @@ -223,7 +224,6 @@ class FullPlotterParameterSerializer(PlotterParameterAllSerializer): def get_plotters(self, obj): all_plotters = Plotter.objects.all() - serializer = FullPlotterSerializer results = {} for plotter in all_plotters.iterator(): 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']) -- GitLab