Skip to content

Commit

Permalink
Temporarily disallow constraints when creating the parent folder chain
Browse files Browse the repository at this point in the history
Fixes #173
  • Loading branch information
ale-rt committed Jan 26, 2023
1 parent e6519ca commit 3d9840e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Changelog
1.8 (unreleased)
----------------

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


1.7 (2023-01-20)
Expand Down
8 changes: 8 additions & 0 deletions src/collective/exportimport/import_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,12 +900,20 @@ def create_container(self, item):
# create original structure for imported content
for element in parent_path:
if element not in folder:
constraints = ISelectableConstrainTypes(folder, None)
constraints_state = constraints and constraints.getConstrainTypesMode()
if constraints_state:
constraints.setConstrainTypesMode(0)
folder = api.content.create(
container=folder,
type="Folder",
id=element,
title=element,
)
if constraints and constraints_state:
constraints.setConstrainTypesMode(constraints_state)
breakpoint()

logger.info(
u"Created container {} to hold {}".format(
folder.absolute_url(), item["@id"]
Expand Down

0 comments on commit 3d9840e

Please sign in to comment.