diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 0403f207..f7ba8b97 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -6,20 +6,20 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.9] + python-version: [3.11] steps: # git checkout - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # python setup - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} # python cache - - uses: actions/cache@v1 + - uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 2baf1b7d..62645d07 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -6,20 +6,20 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.9] + python-version: [3.11] steps: # git checkout - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # python setup - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} # python cache - - uses: actions/cache@v1 + - uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} diff --git a/.github/workflows/pyroma.yml b/.github/workflows/pyroma.yml index d303c4e6..175b7d6b 100644 --- a/.github/workflows/pyroma.yml +++ b/.github/workflows/pyroma.yml @@ -6,20 +6,20 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.9] + python-version: [3.11] steps: # git checkout - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # python setup - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} # python cache - - uses: actions/cache@v1 + - uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b56e6ab8..a692281d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,22 +8,23 @@ jobs: strategy: max-parallel: 4 matrix: - python: ["3.9"] + python: ["3.8"] plone: ["52"] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Cache eggs - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: eggs key: ${{ runner.OS }}-build-python${{ matrix.python }}-${{ matrix.plone }} - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - name: Install dependencies run: | pip install -r requirements.txt -c constraints_plone${{ matrix.plone }}.txt + pip install zc.buildout==3.3 sudo apt-get install libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev \ libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk \ libharfbuzz-dev libfribidi-dev libxcb1-dev diff --git a/.github/workflows/toc.yml b/.github/workflows/toc.yml index e25b55d6..00a954c3 100644 --- a/.github/workflows/toc.yml +++ b/.github/workflows/toc.yml @@ -11,7 +11,7 @@ jobs: - name: Install doctoc run: | sudo npm install -g doctoc - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Generate full TOC run: | doctoc --github --notitle README.md diff --git a/.github/workflows/zpretty.yml b/.github/workflows/zpretty.yml index 1aecb2f0..49a04e3d 100644 --- a/.github/workflows/zpretty.yml +++ b/.github/workflows/zpretty.yml @@ -6,20 +6,20 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.9] + python-version: [3.11] steps: # git checkout - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # python setup - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} # python cache - - uses: actions/cache@v1 + - uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} diff --git a/CHANGES.rst b/CHANGES.rst index 95d8e61c..3003e539 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,8 @@ Changelog 5.1.19 (unreleased) ------------------- -- Nothing changed yet. +- Fix typo in Venue serializer that didn't return the right history version. + [cekk] 5.1.18 (2025-01-21) diff --git a/src/design/plone/contenttypes/restapi/serializers/venue.py b/src/design/plone/contenttypes/restapi/serializers/venue.py index 2f8e7ad8..52296ba4 100644 --- a/src/design/plone/contenttypes/restapi/serializers/venue.py +++ b/src/design/plone/contenttypes/restapi/serializers/venue.py @@ -67,7 +67,9 @@ def get_venue_offices(self, result): def __call__(self, version=None, include_items=True): self.index = "news_venue" - result = super(VenueSerializer, self).__call__(version=None, include_items=True) + result = super(VenueSerializer, self).__call__( + version=version, include_items=True + ) result["venue_services"] = self.get_venue_services(result) result["sede_di"] = self.get_venue_offices(result) return result diff --git a/src/design/plone/contenttypes/tests/test_ct_luogo.py b/src/design/plone/contenttypes/tests/test_ct_luogo.py index c8d02740..778109bb 100644 --- a/src/design/plone/contenttypes/tests/test_ct_luogo.py +++ b/src/design/plone/contenttypes/tests/test_ct_luogo.py @@ -14,7 +14,9 @@ from transaction import commit from z3c.relationfield import RelationValue from zope.component import getUtility +from zope.event import notify from zope.intid.interfaces import IIntIds +from zope.lifecycleevent import ObjectModifiedEvent import unittest @@ -171,3 +173,19 @@ def test_venue_news(self): res["related_news"][1]["@id"], self.news.absolute_url(), ) + + def test_venue_history_return_right_data(self): + venue = api.content.create(container=self.portal, type="Venue", title="venue1") + venue.description = "aaa" + notify(ObjectModifiedEvent(venue)) + venue.description = "aaa bbb" + notify(ObjectModifiedEvent(venue)) + commit() + + response0 = self.api_session.get(f"{venue.absolute_url()}/@history/0").json() + response1 = self.api_session.get(f"{venue.absolute_url()}/@history/1").json() + response2 = self.api_session.get(f"{venue.absolute_url()}/@history/2").json() + + self.assertEqual(response0["description"], "") + self.assertEqual(response1["description"], "aaa") + self.assertEqual(response2["description"], "aaa bbb")