diff --git a/invenio_communities/communities/schema.py b/invenio_communities/communities/schema.py index 606637221..db4cd201e 100644 --- a/invenio_communities/communities/schema.py +++ b/invenio_communities/communities/schema.py @@ -88,9 +88,11 @@ def clean(self, data, **kwargs): Why: We want to allow the output of a Schema dump, to be a valid input to a Schema load without causing strange issues. """ - for name, field in self.fields.items(): - if field.dump_only: - data.pop(name, None) + value_is_dict = isinstance(data, dict) + if value_is_dict: + for name, field in self.fields.items(): + if field.dump_only: + data.pop(name, None) return data