Commit d40e9600 authored by Julien Muchembled's avatar Julien Muchembled

Notify when an activity is not executable (-3)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34303 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0834758e
......@@ -196,6 +196,7 @@ class SQLBase:
# something is missing (context object cannot be found, method cannot
# be accessed on object).
non_executable_message_list.append(uid)
notify_user_list.append((m, False))
if deletable_uid_list:
try:
self._retryOnLockError(activity_tool.SQLBase_delMessage,
......
......@@ -323,7 +323,9 @@ class Message(BaseMessage):
call_traceback = 'Created at:\n%s' % self.call_traceback
fail_count = self.line.retry + 1
if retry:
if m.getExecutionState() == MESSAGE_NOT_EXECUTABLE:
message = "Not executable activity"
elif retry:
message = "Pending activity already failed %s times" % fail_count
else:
message = "Activity failed"
......
......@@ -2336,11 +2336,19 @@ class TestCMFActivity(ERP5TypeTestCase):
Message.notifyUser = fake_notifyUser
Organisation.failingMethod = failingMethod
try:
obj.activate(activity=activity, priority=6).failingMethod()
# MESSAGE_NOT_EXECUTED
obj.activate(activity=activity).failingMethod()
get_transaction().commit()
self.assertEqual(len(notification_done), 0)
self.flushAllActivities(silent=1, loop_size=100)
self.assertEqual(len(notification_done), 1)
# MESSAGE_NOT_EXECUTABLE
obj.getParentValue()._delObject(obj.getId())
obj.activate(activity=activity).getId()
get_transaction().commit()
self.assertEqual(len(notification_done), 1)
self.flushAllActivities(silent=1, loop_size=100)
self.assertEqual(len(notification_done), 2)
finally:
Message.notifyUser = original_notifyUser
delattr(Organisation, 'failingMethod')
......
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