debug script ignore non scodoc folders in Zope

This commit is contained in:
Emmanuel Viennet 2021-05-19 15:15:25 +02:00
parent 66859c53ba
commit 1e53aa21cb

View File

@ -67,7 +67,11 @@ def go(app, n=0, verbose=True):
def go_dept(app, dept, verbose=True): def go_dept(app, dept, verbose=True):
objs = app.ScoDoc.objectValues("Folder") objs = app.ScoDoc.objectValues("Folder")
for o in objs: for o in objs:
try:
context = o.Scolarite context = o.Scolarite
except AttributeError:
# ignore other folders, like old "icons"
continue
if context.DeptId() == dept: if context.DeptId() == dept:
if verbose: if verbose:
print("context in dept ", context.DeptId()) print("context in dept ", context.DeptId())