--- a/src/pyams_content/root/zmi/__init__.py Wed Jul 12 11:43:19 2017 +0200
+++ b/src/pyams_content/root/zmi/__init__.py Wed Jul 12 11:44:19 2017 +0200
@@ -146,7 +146,7 @@
catalog = get_utility(ICatalog)
params = None
for tool in get_all_utilities_registered_for(ISharedTool):
- workflow = get_utility(IWorkflow, name=tool.shared_content_workflow)
+ workflow = IWorkflow(tool)
query = Eq(catalog['content_type'], tool.shared_content_type) & \
Any(catalog['workflow_state'], workflow.waiting_states)
params = params | query if params else query
@@ -191,7 +191,7 @@
catalog = get_utility(ICatalog)
params = None
for tool in get_all_utilities_registered_for(ISharedTool):
- workflow = get_utility(IWorkflow, name=tool.shared_content_workflow)
+ workflow = IWorkflow(tool)
query = Eq(catalog['content_type'], tool.shared_content_type) & \
Any(catalog['workflow_state'], workflow.waiting_states) & \
Eq(catalog['workflow_principal'], self.request.principal.id)
@@ -347,7 +347,7 @@
catalog = get_utility(ICatalog)
params = None
for tool in get_all_utilities_registered_for(ISharedTool):
- workflow = get_utility(IWorkflow, name=tool.shared_content_workflow)
+ workflow = IWorkflow(tool)
query = And(Eq(catalog['content_type'], tool.shared_content_type),
Or(Eq(catalog['role:owner'], self.request.principal.id),
Eq(catalog['role:contributor'], self.request.principal.id)),
@@ -407,7 +407,7 @@
catalog = get_utility(ICatalog)
params = None
for tool in get_all_utilities_registered_for(ISharedTool):
- workflow = get_utility(IWorkflow, name=tool.shared_content_workflow)
+ workflow = IWorkflow(tool)
query = And(Eq(catalog['content_type'], tool.shared_content_type),
Or(Eq(catalog['role:owner'], self.request.principal.id),
Eq(catalog['role:contributor'], self.request.principal.id)),
@@ -467,7 +467,7 @@
catalog = get_utility(ICatalog)
params = None
for tool in get_all_utilities_registered_for(ISharedTool):
- workflow = get_utility(IWorkflow, name=tool.shared_content_workflow)
+ workflow = IWorkflow(tool)
query = And(Eq(catalog['content_type'], tool.shared_content_type),
Or(Eq(catalog['role:owner'], self.request.principal.id),
Eq(catalog['role:contributor'], self.request.principal.id)),
@@ -527,7 +527,7 @@
catalog = get_utility(ICatalog)
params = None
for tool in get_all_utilities_registered_for(ISharedTool):
- workflow = get_utility(IWorkflow, name=tool.shared_content_workflow)
+ workflow = IWorkflow(tool)
query = And(Eq(catalog['content_type'], tool.shared_content_type),
Or(Eq(catalog['role:owner'], self.request.principal.id),
Eq(catalog['role:contributor'], self.request.principal.id)),
@@ -589,7 +589,7 @@
params = None
principal_id = self.request.principal.id
for tool in get_all_utilities_registered_for(ISharedTool):
- workflow = get_utility(IWorkflow, name=tool.shared_content_workflow)
+ workflow = IWorkflow(tool)
query = And(Eq(catalog['content_type'], tool.shared_content_type),
Or(Eq(catalog['role:owner'], principal_id),
Eq(catalog['role:contributor'], principal_id)),
@@ -677,7 +677,7 @@
catalog = get_utility(ICatalog)
params = None
for tool in get_all_utilities_registered_for(ISharedTool):
- workflow = get_utility(IWorkflow, name=tool.shared_content_workflow)
+ workflow = IWorkflow(tool)
query = And(Eq(catalog['content_type'], tool.shared_content_type),
Any(catalog['workflow_state'], workflow.published_states))
params = params | query if params else query