diff --git a/helpers/models.py b/helpers/models.py index 83cfc50..6ab4a28 100644 --- a/helpers/models.py +++ b/helpers/models.py @@ -32,6 +32,6 @@ USchema = marshmallow_dataclass.class_schema(User) class UserSchema(USchema): def load(self, entity, *args, **kwargs): - if 'next_daily_notify_time' in entity: + if entity.get('next_daily_notify_time', None): entity['next_daily_notify_time'] = entity['next_daily_notify_time'].strftime("%Y-%m-%dT%H:%M:00.000+00:00") return super().load(entity, *args, **kwargs)