Skip to content

Commit

Permalink
Add importi_viaggi_servizio as block field in Incarico response (#262)
Browse files Browse the repository at this point in the history
* Add importi_viaggi_servizio as block field in Incarico response

* black
  • Loading branch information
eikichi18 authored Jun 10, 2024
1 parent 9974f66 commit 153cee8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ default_stages: [commit, push]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 24.4.2
hooks:
- id: black
# args: ["--line-length=88", "--check", "--diff", "--force-exclude=migrations", "src/"]
args: ["--line-length=88", "--force-exclude=migrations", "src/"]
types: [python]
entry: black
- repo: https://github.com/PyCQA/flake8.git
rev: "6.1.0"
rev: "7.0.0"
hooks:
- id: flake8
name: flake8
Expand All @@ -31,7 +31,7 @@ repos:
types: [python]
args: ["--max-complexity=30", "--max-line-length=88", "--ignore=DJ01,DJ08,W503,ANN101", "--exclude=docs/*", "src/", "setup.py"]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
Expand Down
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
6.2.10 (unreleased)
-------------------

- Nothing changed yet.
- Add importi_viaggio_servizio field as block field in Incarico response
[eikichi18]


6.2.9 (2024-05-21)
Expand Down
7 changes: 7 additions & 0 deletions src/design/plone/contenttypes/restapi/serializers/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,13 @@ def __call__(self, **kwargs):
else:
res["compensi"] = json_compatible([])

if "importi_viaggio_servizio" not in res:
res["importi_viaggio_servizio"] = json_compatible(
self.context.importi_viaggio_servizio
)
else:
res["importi_viaggio_servizio"] = json_compatible([])

if safe_hasattr(self.context, "compensi-file"):
compensi_folder = getattr(self.context, "compensi-file")
res["compensi_file"] = []
Expand Down

0 comments on commit 153cee8

Please sign in to comment.