Commit 726f5d1e authored by Jérome Perrin's avatar Jérome Perrin

core: fix Folder_cut to check relations of sub-objects

This `o` was an unused variable. The initial intention was probably
this.
parent 3339ba42
Pipeline #6902 failed with stage
in 0 seconds
......@@ -4,8 +4,8 @@ Base_translateString = portal.Base_translateString
def Object_hasRelation(obj):
# Check if there is some related objets.
result = 0
for o in obj.getIndexableChildValueList():
for related in obj.portal_categories.getRelatedValueList(obj):
for sub_obj in obj.getIndexableChildValueList():
for related in obj.portal_categories.getRelatedValueList(sub_obj):
if related.getRelativeUrl().startswith(obj.getRelativeUrl()):
continue
elif related.getRelativeUrl().startswith('portal_simulation') :
......
  • I looked a bit more at the history of this code:

    This code was added in 5d08412f which was at the time same as Folder_delete (with the same unused variable).

    Then Folder_delete was changed ( in a6ec9f69 ) to getRelationCountForDeletion. I'll see if we can use getRelationCountForDeletion here as well instead.

  • mentioned in merge request !996 (merged)

    Toggle commit list
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment