mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-10 15:22:24 -05:00
Make pre/post processors return modified data
https://marshmallow.readthedocs.io/en/stable/upgrading.html#pre-post-processors-must-return-modified-data We had a few cases where the pre/post processors weren't returning anything. They now need to return the modified data.
This commit is contained in:
@@ -59,6 +59,7 @@ class UUIDsAsStringsMixin:
|
||||
(str(item) if isinstance(item, UUID) else item)
|
||||
for item in value
|
||||
]
|
||||
return data
|
||||
|
||||
|
||||
class BaseSchema(ma.SQLAlchemyAutoSchema):
|
||||
@@ -282,6 +283,8 @@ class ServiceSchema(BaseSchema, UUIDsAsStringsMixin):
|
||||
|
||||
in_data['permissions'] = permissions
|
||||
|
||||
return in_data
|
||||
|
||||
|
||||
class DetailedServiceSchema(BaseSchema):
|
||||
statistics = fields.Dict()
|
||||
@@ -383,6 +386,8 @@ class TemplateSchemaNoDetail(TemplateSchema):
|
||||
if template.template_type != models.BROADCAST_TYPE:
|
||||
template.content = None
|
||||
|
||||
return template
|
||||
|
||||
|
||||
class TemplateHistorySchema(BaseSchema):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user