Skip to content

Commit

Permalink
Merge pull request #432 from collective/fix-plone6-upgrade
Browse files Browse the repository at this point in the history
Fix Plone 5 related upgrade steps in Plone 6.
  • Loading branch information
thet authored Oct 8, 2024
2 parents cb88b05 + 8706cd5 commit 18000cd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Changelog
4.2.1 (unreleased)
------------------

- Fix Plone 5 related upgrade steps in Plone 6.
[thet]

- Add plone.shortname behaviour to EasyForm type.
[ThibautBorn]

Expand Down
11 changes: 11 additions & 0 deletions src/collective/easyform/upgrades/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
from importlib import import_module
from plone import api

import logging


logger = logging.getLogger(__name__)

HAS_PLONE_6 = getattr(
import_module("Products.CMFPlone.factory"), "PLONE60MARKER", False
)


def update_last_compilation(context, timetuple=None):
if HAS_PLONE_6:
# No need to update the `last_compilation` time on Plone 6.
# The resources are refreshed with every restart of the instance
# automatically.
return

# Let's do the imports inline, so they are not needlessly done at startup.
# Should not really matter, but oh well.
from datetime import datetime
Expand Down

0 comments on commit 18000cd

Please sign in to comment.