From c8dfa7e21f7bb7b19ad1a28da5890ba60b609a69 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Mon, 24 Jan 2022 12:50:28 +0100 Subject: [PATCH] #31 API POST Intervention * adds check for deserializing of konova codes --- api/utils/serializer/v1/serializer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/utils/serializer/v1/serializer.py b/api/utils/serializer/v1/serializer.py index 984038da..63c71827 100644 --- a/api/utils/serializer/v1/serializer.py +++ b/api/utils/serializer/v1/serializer.py @@ -63,6 +63,8 @@ class AbstractModelAPISerializerV1(AbstractModelAPISerializer): Returns: """ + if json_str is None or len(json_str) == 0: + return None code = KonovaCode.objects.get( atom_id=json_str, code_lists__in=[code_list_identifier]