Commit 48bb78ff authored by Arnaud Fontaine's avatar Arnaud Fontaine

Fix the infinite recursion when solving Portal Types dependencies in a

better way than an plain assert


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40845 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6717d2c8
......@@ -1896,8 +1896,12 @@ class PortalTypeTemplateItem(ObjectTemplateItem):
else:
portal_type = klass.__name__
depend = path_dict.get(portal_type)
# Prevent infinite recursion
assert depend != path
# Prevent infinite recursion for 'portal_types/Base Type',
# only relevant with Portal Types classes because 'Base Type'
# is an 'erp5.portal_type.Base Type' class
if depend == path:
assert depend == 'portal_types/Base Type'
return 0, path
cache[path] = score = depend and 1 + solveDependency(depend)[0] or 0
return score, path
PersistentMigrationMixin._no_migration += 1
......
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