unify state handling for concepts and resources on display and search

This commit is contained in:
Helmut Merz 2013-10-05 11:03:47 +02:00
parent 26906601f2
commit f9801e184b
2 changed files with 3 additions and 5 deletions

View file

@ -702,10 +702,10 @@ class BaseView(GenericView, I18NView):
if not checkPermission(self.viewStatesPermission, self.context):
return result
if IResource.providedBy(self.target):
statesDefs = self.globalOptions('organize.stateful.resource', ())
statesDefs = (self.globalOptions('organize.stateful.resource') or [])
else:
statesDefs = ((self.globalOptions('organize.stateful.concept') or []) +
(self.typeOptions('organize.stateful') or []))
statesDefs = (self.globalOptions('organize.stateful.concept') or [])
statesDefs += (self.typeOptions('organize.stateful') or [])
for std in statesDefs:
stf = component.getAdapter(self.target, IStateful, name=std)
result.append(stf)

View file

@ -257,8 +257,6 @@ class Search(ConceptView):
return self.viewIterator(result)
def checkStates(self, obj):
if not IResource.providedBy(obj):
return True
for std, states in self.selectedStates.items():
if std.startswith('state.resource.'):
std = std[len('state.resource.'):]