Skip to content

Commit cd0e0c7

Browse files
committed
Temporarily disallow constraints when creating the parent folder chain
Fixes #173
1 parent e6519ca commit cd0e0c7

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

CHANGES.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ Changelog
55
1.8 (unreleased)
66
----------------
77

8-
- Nothing changed yet.
8+
- Temporarily disallow constraints when creating the parent folder chain.
9+
(#173)
10+
[ale-rt]
911

1012

1113
1.7 (2023-01-20)

src/collective/exportimport/import_content.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,12 +900,19 @@ def create_container(self, item):
900900
# create original structure for imported content
901901
for element in parent_path:
902902
if element not in folder:
903+
constraints = ISelectableConstrainTypes(folder, None)
904+
constraints_state = constraints and constraints.getConstrainTypesMode()
905+
if constraints_state:
906+
constraints.setConstrainTypesMode(0)
903907
folder = api.content.create(
904908
container=folder,
905909
type="Folder",
906910
id=element,
907911
title=element,
908912
)
913+
if constraints and constraints_state:
914+
constraints.setConstrainTypesMode(constraints_state)
915+
909916
logger.info(
910917
u"Created container {} to hold {}".format(
911918
folder.absolute_url(), item["@id"]

0 commit comments

Comments
 (0)