diff --git a/helpers/models.py b/helpers/models.py index 9ad46c0..4bb86a0 100644 --- a/helpers/models.py +++ b/helpers/models.py @@ -31,8 +31,7 @@ USchema = marshmallow_dataclass.class_schema(User) class UserSchema(USchema): - @pre_load - def stringify_time(self, data, many, **kwargs): - if 'next_daily_notify_time' in data: - data['next_daily_notify_time'] = str(data['next_daily_notify_time']) - return data + def load(self, entity, *args, **kwargs): + if 'next_daily_notify_time' in entity: + entity['next_daily_notify_time'] = str(entity['next_daily_notify_time']) + return super().load(entity, *args, **kwargs)