Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ parts =
coverage
test-coverage
createcoverage
releaser
# releaser
i18ndude
omelette
robot
Expand Down
8 changes: 5 additions & 3 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ Changelog
1.6.1 (unreleased)
------------------

- gestione deserizlizer per datetime, nel caso il campo abbia avvutto
un cambianeto di ttipo (datte->datetime)
- gestione deserizlizer per datetime, nel caso il campo abbia avuto
un cambiamento di tipo (date->datetime)
[mamico]
- lint/isort
[mamico]
- Fix upgrade-step to handle malformed data.
[cekk]

- Fix search_bandi view to work only with Bando types and not break.
[cekk]

1.6.0 (2025-03-13)
------------------

Expand Down
15 changes: 11 additions & 4 deletions redturtle/bandi/browser/search.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from DateTime import DateTime
from plone import api
from plone.api.exc import InvalidParameterError
from Products.CMFCore.utils import getToolByName
from Products.Five.browser import BrowserView
from six.moves.urllib.parse import quote
Expand Down Expand Up @@ -109,6 +110,8 @@ def searchBandi(self):
}
if "SearchableText" in self.request.form and not SearchableText:
del query["SearchableText"]
if "portal_type" not in query:
query["portal_type"] = "Bando"
return pc(**query)

@property
Expand Down Expand Up @@ -141,10 +144,14 @@ def rss_query(self):
def getBandoState(self, brain):
""" """
bando = brain.getObject()
view = api.content.get_view(
name="bando_view", context=bando, request=self.request
)
return view.getBandoState()
try:
view = api.content.get_view(
name="bando_view", context=bando, request=self.request
)
return view.getBandoState()
except InvalidParameterError:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in quali casi hai potenzialmente questo errore? aggiungi un commento per spiegarlo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se uno forza portal_type diverso da Bando, ha come risultati oggetti che non sono Bando e che non hanno quindi quella vista

# if for some reason there are not only Bando objects in results, do not break the view
return ()

def isValidDeadline(self, date):
""" """
Expand Down
46 changes: 46 additions & 0 deletions test_plone60.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,49 @@ pycodestyle = 2.14.0
# Required by:
# collective.tiles.collection==2.0.0
z3c.jbot = 2.0

# Added by buildout at 2026-01-14 10:27:31.461276
Products.PDBDebugMode = 3.0.0
bleach = 6.0.0
collective-tiles-collection = 2.1.1
coverage = 7.2.2
createcoverage = 1.5
flake8-coding = 1.3.2
flake8-debugger = 4.1.2
flake8-print = 5.0.0
i18ndude = 5.5.0
keyring = 23.13.1
markdown-it-py = 2.2.0
mdurl = 0.1.2
pkginfo = 1.9.6
plone-recipe-codeanalysis = 3.0.1
readme-renderer = 37.3
requests-toolbelt = 0.10.1
rfc3986 = 2.0.0
rich = 13.3.4
twine = 4.0.2
zest.releaser = 7.3.0

# Required by:
# plone-recipe-codeanalysis==3.0.1
check-manifest = 0.49

# Required by:
# keyring==23.13.1
jaraco.classes = 3.2.3

# Required by:
# jaraco.classes==3.2.3
more-itertools = 9.1.0

# Required by:
# collective-tiles-collection==2.1.1
plone.app.tiles = 5.0.0

# Required by:
# bleach==6.0.0
webencodings = 0.5.1

# Required by:
# collective-tiles-collection==2.1.1
z3c.jbot = 3.1
Loading