Skip to content

Commit

Permalink
fix missing annotations handling in marshmallow (#637)
Browse files Browse the repository at this point in the history
  • Loading branch information
olevski committed Apr 27, 2021
1 parent acc8ded commit 23e54b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions renku_notebooks/api/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 23e54b0

Please sign in to comment.