Fix error when collection is not found
This commit is contained in:
parent
17972a91c4
commit
605f354a6d
|
@ -14,7 +14,8 @@
|
|||
<span class="portletTopRight"></span>
|
||||
</dt>
|
||||
|
||||
<dd class="portletItem" tal:define="table python: view.table()">
|
||||
<dd class="portletItem" tal:define="table python: view.table()"
|
||||
tal:condition="table">
|
||||
<div tal:attributes="class python: table.__class__.__name__"
|
||||
tal:content="structure python: table.render()">
|
||||
</div>
|
||||
|
|
|
@ -152,7 +152,10 @@ class Renderer(base.Renderer):
|
|||
return result
|
||||
|
||||
def table(self):
|
||||
table_class = get_appropriate_table_class(self.context, self.collection().query)
|
||||
collection = self.collection()
|
||||
if collection is None:
|
||||
return
|
||||
table_class = get_appropriate_table_class(self.context, collection.query)
|
||||
table = table_class(self, self.request)
|
||||
table.values = self.results()
|
||||
table.update()
|
||||
|
|
Reference in New Issue