mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-09 12:29:51 -04:00
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.
This commit is contained in:
@@ -416,14 +416,14 @@ class ApiKeySchema(BaseSchema):
|
|||||||
|
|
||||||
class JobSchema(BaseSchema):
|
class JobSchema(BaseSchema):
|
||||||
created_by_user = fields.Nested(UserSchema, attribute="created_by",
|
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)
|
created_by = field_for(models.Job, 'created_by', required=True, load_only=True)
|
||||||
|
|
||||||
job_status = field_for(models.JobStatus, 'name', required=False)
|
job_status = field_for(models.JobStatus, 'name', required=False)
|
||||||
|
|
||||||
scheduled_for = fields.DateTime()
|
scheduled_for = fields.DateTime()
|
||||||
service_name = fields.Nested(
|
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_name = fields.Method('get_template_name', dump_only=True)
|
||||||
template_type = fields.Method('get_template_type', dump_only=True)
|
template_type = fields.Method('get_template_type', dump_only=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user