From 339f0746813f909b12be13cb3a1229acdf5eba49 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Mon, 25 Apr 2022 13:47:07 +0200 Subject: [PATCH] HOTFIX: API * hardens atom_id input to be integer or string compatible --- api/utils/serializer/v1/serializer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/utils/serializer/v1/serializer.py b/api/utils/serializer/v1/serializer.py index 23d1f692..9d3b9dfb 100644 --- a/api/utils/serializer/v1/serializer.py +++ b/api/utils/serializer/v1/serializer.py @@ -75,7 +75,10 @@ class AbstractModelAPISerializerV1(AbstractModelAPISerializer): Returns: """ - if json_str is None or len(json_str) == 0: + if json_str is None: + return None + json_str = str(json_str) + if len(json_str) == 0: return None code = KonovaCode.objects.get( atom_id=json_str,