From 23e54b06620b341000fde4b7f5917284e8a17bf0 Mon Sep 17 00:00:00 2001 From: Tasko Olevski Date: Tue, 27 Apr 2021 13:33:56 +0200 Subject: [PATCH] fix missing annotations handling in marshmallow (#637) --- renku_notebooks/api/schemas.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renku_notebooks/api/schemas.py b/renku_notebooks/api/schemas.py index d22e907d8..98e9e21fe 100644 --- a/renku_notebooks/api/schemas.py +++ b/renku_notebooks/api/schemas.py @@ -130,10 +130,10 @@ class UserPodAnnotations( class Meta: unknown = INCLUDE - def get_attribute(self, obj, key, *args, **kwargs): + def get_attribute(self, obj, key, default, *args, **kwargs): # in marshmallow, any schema key with a dot in it is converted to nested dictionaries # in marshmallow, this overrides that behaviour for dumping (serializing) - return obj[key] + return obj.get(key, default) @post_load def unnest_keys(self, data, **kwargs):