Commits

Kai Diefenbach committed 938cb20

Improved code to get children from object or portal.

  • Participants
  • Parent commits 369a21b

Comments (0)

Files changed (1)

File lfc_compositor/fields.py

                 temp = temp.parent
         else:
             obj = lfc.utils.get_portal()
-
-        if obj.parent:
+        
+        try:    
             children = obj.parent.get_children(self.request)
-        else:
+        except AttributeError:
             children = lfc.utils.get_portal().get_children(self.request)
 
         html = """<div id="reference-input">"""