Skip to content

Commit

Permalink
version 1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
gdoumenc committed Nov 15, 2024
1 parent 61e8473 commit 2074777
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions coworks/extension/jsonapi/jsonapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from flask.typing import ResponseReturnValue
from jsonapi_pydantic.v1_0 import Error
from jsonapi_pydantic.v1_0 import ErrorLinks
from jsonapi_pydantic.v1_0 import Resource
from jsonapi_pydantic.v1_0 import TopLevel
from jsonapi_pydantic.v1_0.toplevel import Errors
from pydantic import ValidationError
Expand Down Expand Up @@ -93,7 +92,6 @@ def _handle_http_exception(e):
errors = [Error(id=e.name, title=e.name, detail=e.description, status=e.code)]
return toplevel_error_response(errors, status_code=InternalServerError.code)


def _handle_user_exception(e):
if 'application/vnd.api+json' not in request.headers.getlist('accept'):
return handle_user_exception(e)
Expand Down Expand Up @@ -268,7 +266,7 @@ def toplevel_from_data(res: JsonApiDataMixin, include: set[str], exclude: set[st
"""
filtered_fields = fetching_context.field_names(res.jsonapi_type) | include
data, included = res.to_resource(include=filtered_fields, exclude=exclude)
return TopLevel(data=Resource(**data), included=included.values() if included else None)
return TopLevel(data=data, included=included.values() if included else None)


def toplevel_from_pagination(pagination: type[Pagination], include: set[str], exclude: set[str]):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "pdm.backend"

[project]
name = "coworks"
version = "1.1.17"
version = "1.1.18"
description = "CoWorks is a unified compositional microservices framework using Flask/Airflow on AWS serverless technologies."
readme = "README.rst"
requires-python = ">= 3.12"
Expand Down

0 comments on commit 2074777

Please sign in to comment.