From 7cc30ca7588a0dbbcf47b36683e96f64edb307cd Mon Sep 17 00:00:00 2001 From: Samuel Gaist <samuel.gaist@idiap.ch> Date: Thu, 23 Apr 2020 09:33:36 +0200 Subject: [PATCH] [common][fields] Remove JSONSerializerField as DRF already provides such a field --- beat/web/common/fields.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/beat/web/common/fields.py b/beat/web/common/fields.py index fc932fbba..8fb8d8d53 100644 --- a/beat/web/common/fields.py +++ b/beat/web/common/fields.py @@ -26,21 +26,7 @@ ############################################################################### from rest_framework import serializers -from django.utils import six - -import simplejson class StringListField(serializers.ListField): child = serializers.CharField() - - -class JSONSerializerField(serializers.Field): - """ Serializer for JSONField -- required to make field writable""" - def to_internal_value(self, data): - if isinstance(data, six.string_types): - return simplejson.loads(data) - return data - - def to_representation(self, value): - return value -- GitLab