From 4635a00caf6d504baedd8d54151f020f0bbae837 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Wed, 3 Jan 2024 17:33:21 +0100 Subject: [PATCH] fix portlet selection; simplify options retrieval --- organize/personal/browser/configurator.py | 2 ++ util.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/organize/personal/browser/configurator.py b/organize/personal/browser/configurator.py index e93e44e..3f8fc94 100644 --- a/organize/personal/browser/configurator.py +++ b/organize/personal/browser/configurator.py @@ -59,6 +59,8 @@ class PortletConfigurator(ViewConfigurator): return getPersonForUser(self.context, self.request) def hasFavorites(self): + if 'favorites' in (self.view.globalOptions.cco.storage.records or []): + return True if self.records is not None: return 'favorites' in self.records return False diff --git a/util.py b/util.py index 5e3f558..9797ee6 100644 --- a/util.py +++ b/util.py @@ -124,8 +124,8 @@ def reindex(obj, catalog=None): def records(context, name, factory): root = context.getLoopsRoot() opts = IOptions(root) - if name in (opts('cco.storage.records') or []): - schema = (opts('cco.storage.schema') or [None])[0] + if name in (opts.cco.storage.records or []): + schema = (opts.cco.storage.schema or [None])[0] storage = Storage(getEngine(config.dbengine, config.dbname, config.dbuser, config.dbpassword, host=config.dbhost, port=config.dbport),