fix portlet selection; simplify options retrieval
This commit is contained in:
parent
64ad40fb96
commit
4635a00caf
2 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
4
util.py
4
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),
|
||||
|
|
Loading…
Add table
Reference in a new issue