From 1a0deb48eb2678155936631cf8aa91f31e8fec98 Mon Sep 17 00:00:00 2001 From: delcroip Date: Thu, 3 Oct 2024 11:46:31 +0200 Subject: [PATCH] avoid errors --- grievance_social_protection/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grievance_social_protection/util.py b/grievance_social_protection/util.py index daf8cdd..46f4956 100644 --- a/grievance_social_protection/util.py +++ b/grievance_social_protection/util.py @@ -17,6 +17,6 @@ def underscore_to_camel(name): def model_obj_to_json(model_obj): model_obj_dict = model_obj.__dict__ - model_obj_dict.pop('_state') + model_obj_dict.pop('_state', None) model_obj_dict = {underscore_to_camel(k): v for k, v in list(model_obj_dict.items())} return json.dumps(model_obj_dict, cls=DjangoJSONEncoder)