Commit 560ccc5d authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

erp5_base: create an Active Process for successful case as well if the last result is bad.

parent 20c95080
from Products.CMFActivity.ActiveResult import ActiveResult
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, ComplexQuery
portal = context.getPortalObject()
result = []
sql_result = portal.ERP5Site_zGetDuplicateLoginReferenceList()
if len(sql_result):
from Products.CMFActivity.ActiveResult import ActiveResult
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, ComplexQuery
query = ComplexQuery(
*[ComplexQuery(SimpleQuery(portal_type=i['portal_type']),
SimpleQuery(reference=i['reference'])) for i in sql_result],
......@@ -16,6 +16,13 @@ if len(sql_result):
active_result.edit(summary='Logins having the same reference exist',
severity=len(sql_result),
detail='\n'.join(result))
active_process = context.newActiveProcess()
active_process.postResult(active_result)
return active_process
elif context.sense():
active_result = ActiveResult()
active_result.edit(summary='Logins having the same reference does not exist',
severity=0)
else:
return
active_process = context.newActiveProcess()
active_process.postResult(active_result)
return active_process
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment