unify state handling for concepts and resources on display and search
This commit is contained in:
parent
26906601f2
commit
f9801e184b
2 changed files with 3 additions and 5 deletions
|
@ -702,10 +702,10 @@ class BaseView(GenericView, I18NView):
|
||||||
if not checkPermission(self.viewStatesPermission, self.context):
|
if not checkPermission(self.viewStatesPermission, self.context):
|
||||||
return result
|
return result
|
||||||
if IResource.providedBy(self.target):
|
if IResource.providedBy(self.target):
|
||||||
statesDefs = self.globalOptions('organize.stateful.resource', ())
|
statesDefs = (self.globalOptions('organize.stateful.resource') or [])
|
||||||
else:
|
else:
|
||||||
statesDefs = ((self.globalOptions('organize.stateful.concept') or []) +
|
statesDefs = (self.globalOptions('organize.stateful.concept') or [])
|
||||||
(self.typeOptions('organize.stateful') or []))
|
statesDefs += (self.typeOptions('organize.stateful') or [])
|
||||||
for std in statesDefs:
|
for std in statesDefs:
|
||||||
stf = component.getAdapter(self.target, IStateful, name=std)
|
stf = component.getAdapter(self.target, IStateful, name=std)
|
||||||
result.append(stf)
|
result.append(stf)
|
||||||
|
|
|
@ -257,8 +257,6 @@ class Search(ConceptView):
|
||||||
return self.viewIterator(result)
|
return self.viewIterator(result)
|
||||||
|
|
||||||
def checkStates(self, obj):
|
def checkStates(self, obj):
|
||||||
if not IResource.providedBy(obj):
|
|
||||||
return True
|
|
||||||
for std, states in self.selectedStates.items():
|
for std, states in self.selectedStates.items():
|
||||||
if std.startswith('state.resource.'):
|
if std.startswith('state.resource.'):
|
||||||
std = std[len('state.resource.'):]
|
std = std[len('state.resource.'):]
|
||||||
|
|
Loading…
Add table
Reference in a new issue