I receive an email body with some strings that are None instead of "".
I have tried using missing, default, allow_none, and other hacks I found online but nothing works.
I want to turn None to "" in my schema. I thought a simple email = fields.String(missing = "") would work, but I guess None does not count as missing.
Schema:
class CustomerSchema(Schema):
@post_dump
def change_none_to_string(self, data, **kwargs):
for field in data:
if data[field] is None:
data[field] = ""
return data
firstname = fields.String(missing = "")
lastname = fields.String(missing = "")
email = fields.String(missing = "")