From ab2c33f1a37072300c8c51573adf5c19510ae798 Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Fri, 6 May 2022 15:57:44 +0100 Subject: [PATCH] Replace `dump_to` with `data_key` https://marshmallow.readthedocs.io/en/stable/upgrading.html#load-from-and-dump-to-are-merged-into-data-key No change to how things work here, just a kwarg that has been renamed. --- app/schemas.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/schemas.py b/app/schemas.py index 3952c7b23..971fbae1f 100644 --- a/app/schemas.py +++ b/app/schemas.py @@ -416,14 +416,14 @@ class ApiKeySchema(BaseSchema): class JobSchema(BaseSchema): created_by_user = fields.Nested(UserSchema, attribute="created_by", - dump_to="created_by", only=["id", "name"], dump_only=True) + data_key="created_by", only=["id", "name"], dump_only=True) created_by = field_for(models.Job, 'created_by', required=True, load_only=True) job_status = field_for(models.JobStatus, 'name', required=False) scheduled_for = fields.DateTime() service_name = fields.Nested( - ServiceSchema, attribute="service", dump_to="service_name", only=["name"], dump_only=True) + ServiceSchema, attribute="service", data_key="service_name", only=["name"], dump_only=True) template_name = fields.Method('get_template_name', dump_only=True) template_type = fields.Method('get_template_type', dump_only=True)