Skip to content

Commit

Permalink
Improved "Buone pratiche" view for Event - US #49677 (#225)
Browse files Browse the repository at this point in the history
* Improved "Buone pratiche" view for Event: checking both for relation with Evenue and coordinates.

* fixed typo

* blacked
  • Loading branch information
daniele-andreotti authored Dec 15, 2023
1 parent 6b8e0f7 commit 1ede644
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
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.1.6 (unreleased)
------------------

- Nothing changed yet.
- Improved "Buone pratiche" view for Event: checking both for relation with Venue and coordinates.
[daniele]


6.1.5 (2023-12-13)
Expand Down
11 changes: 10 additions & 1 deletion src/design/plone/contenttypes/browser/utils/check_eventi.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@ def information_dict(self, evento):
if not [x for x in res if x]:
prezzo = ""

luoghi_correlati = False
if getattr(evento, "luoghi_correlati", None):
luoghi_correlati = True
elif getattr(evento, "geolocation", None):
if getattr(evento.geolocation, "latitude", "") and getattr(
evento.geolocation, "longitude", ""
):
luoghi_correlati = True

return {
"description": getattr(evento, "description", "").strip(),
"effective_date": getattr(evento, "effective_date", None),
"luoghi_correlati": getattr(evento, "luoghi_correlati", None),
"luoghi_correlati": luoghi_correlati,
"prezzo": prezzo,
"contact_info": getattr(evento, "contact_info", None),
}
Expand Down

0 comments on commit 1ede644

Please sign in to comment.