diff --git a/CHANGES.rst b/CHANGES.rst index bc91a3a5..e422efc6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,8 @@ Changelog 6.2.13 (unreleased) ------------------- -- Nothing changed yet. +- Set `file_principale` field as primary, so we call @@download on the content, that file will be downloaded automatically. + [cekk] 6.2.12 (2024-06-24) diff --git a/src/design/plone/contenttypes/behaviors/multi_file.py b/src/design/plone/contenttypes/behaviors/multi_file.py index 11e306b4..90dbc1fa 100644 --- a/src/design/plone/contenttypes/behaviors/multi_file.py +++ b/src/design/plone/contenttypes/behaviors/multi_file.py @@ -41,6 +41,8 @@ class IMultiFileSchema(model.Schema): required=False, ) + model.primary("file_principale") + @provider(IFormFieldProvider) class IMultiFile(IMultiFileSchema): diff --git a/src/design/plone/contenttypes/restapi/serializers/dxcontent.py b/src/design/plone/contenttypes/restapi/serializers/dxcontent.py index a87880c6..568cc3a3 100644 --- a/src/design/plone/contenttypes/restapi/serializers/dxcontent.py +++ b/src/design/plone/contenttypes/restapi/serializers/dxcontent.py @@ -51,7 +51,6 @@ def __call__(self, version=None, include_items=True): @adapter(IDexterityContainer, IDesignPloneContenttypesLayer) class SerializeFolderToJson(BaseFolderSerializer, MetaTypeSerializer): def __call__(self, version=None, include_items=True): - result = super(SerializeFolderToJson, self).__call__( version=version, include_items=include_items ) diff --git a/src/design/plone/contenttypes/upgrades/to_730x.py b/src/design/plone/contenttypes/upgrades/to_730x.py index 5ec2ca47..5d5dcf3a 100644 --- a/src/design/plone/contenttypes/upgrades/to_730x.py +++ b/src/design/plone/contenttypes/upgrades/to_730x.py @@ -96,7 +96,11 @@ def to_7304(context): def to_7305(context): mapping = SUBFOLDERS_MAPPING["Servizio"] - mapping = [folder for folder in mapping.get('content') if folder["id"] == "modulistica"][0] # noqa + mapping = [ + folder for folder in mapping.get("content") if folder["id"] == "modulistica" + ][ + 0 + ] # noqa brains = api.content.find(portal_type="Servizio") tot = len(brains) i = 0