From fe2a59b9fb96a11795db06f72ddde5d00fd29b5d Mon Sep 17 00:00:00 2001 From: Valentin Dumitru <1492705+valipod@users.noreply.github.com> Date: Fri, 8 Nov 2024 18:31:08 +0200 Subject: [PATCH 1/2] Weird fix for when `modified` is not called --- plone/namedfile/scaling.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plone/namedfile/scaling.py b/plone/namedfile/scaling.py index 8f2c9c4b..369b7bca 100644 --- a/plone/namedfile/scaling.py +++ b/plone/namedfile/scaling.py @@ -564,7 +564,10 @@ def modified(self, fieldname=None): if fieldname is not None: field = getattr(context, fieldname, None) modified = getattr(field, "modified", None) - date = DateTime(modified or context._p_mtime) + try: + date = DateTime(modified or context._p_mtime) + except: + date = DateTime(modified() or context._p_mtime) else: date = DateTime(context._p_mtime) return date.millis() From 004b36a216afc71072e47f032665a38b2a1f62c9 Mon Sep 17 00:00:00 2001 From: Marcel Liebischer Date: Wed, 26 Feb 2025 11:54:08 +0100 Subject: [PATCH 2/2] Delete file pyproject.toml to fix weird problem with pkg_resources and editable packages install pkg_resources.DistributionNotFound: The 'plone.namedfile' distribution was not found and is required by plone.app.vocabularies, plone.outputfilters, plone.app.users --- pyproject.toml | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 03fe8fd2..00000000 --- a/pyproject.toml +++ /dev/null @@ -1,35 +0,0 @@ -[tool.towncrier] -filename = "CHANGES.rst" -directory = "news/" -title_format = "{version} ({project_date})" -underlines = ["-", ""] - -[[tool.towncrier.type]] -directory = "breaking" -name = "Breaking changes:" -showcontent = true - -[[tool.towncrier.type]] -directory = "feature" -name = "New features:" -showcontent = true - -[[tool.towncrier.type]] -directory = "bugfix" -name = "Bug fixes:" -showcontent = true - -[[tool.towncrier.type]] -directory = "internal" -name = "Internal:" -showcontent = true - -[[tool.towncrier.type]] -directory = "documentation" -name = "Documentation:" -showcontent = true - -[[tool.towncrier.type]] -directory = "tests" -name = "Tests" -showcontent = true