From 605f354a6d34d0eefb5012b11717bc0fe3a1171e Mon Sep 17 00:00:00 2001 From: Laurent Lasudry Date: Wed, 7 Nov 2018 11:02:13 +0100 Subject: [PATCH] Fix error when collection is not found --- src/pfwbged/collection/portlet.pt | 3 ++- src/pfwbged/collection/portlet.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pfwbged/collection/portlet.pt b/src/pfwbged/collection/portlet.pt index 72411eb..76418b2 100644 --- a/src/pfwbged/collection/portlet.pt +++ b/src/pfwbged/collection/portlet.pt @@ -14,7 +14,8 @@ -
+
diff --git a/src/pfwbged/collection/portlet.py b/src/pfwbged/collection/portlet.py index 9f6c71e..ac99b37 100644 --- a/src/pfwbged/collection/portlet.py +++ b/src/pfwbged/collection/portlet.py @@ -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()