Commit 22e7763d authored by Sebastien Robin's avatar Sebastien Robin

remove duplicate of code

parent 6c3622c9
......@@ -1302,12 +1302,10 @@ class ActivityTool (Folder, UniqueObject):
"""
Restart one or several messages
"""
if activity == 'SQLQueue':
for message_uid in message_uid_list:
self.SQLQueue_restartMessage(message_uid=message_uid)
else:
for message_uid in message_uid_list:
self.SQLDict_restartMessage(message_uid=message_uid)
if not(isinstance(message_uid_list, list)):
message_uid_list = [message_uid_list]
self.SQLBase_makeMessageListAvailable(table=activity_dict[activity].sql_table,
uid=message_uid_list)
if REQUEST is not None:
return REQUEST.RESPONSE.redirect('%s/%s' % (
self.absolute_url(), 'view'))
......@@ -1331,12 +1329,10 @@ class ActivityTool (Folder, UniqueObject):
"""
Delete one or several messages
"""
if activity == 'SQLQueue':
for message_uid in message_uid_list:
self.SQLQueue_deleteMessage(message_uid=message_uid)
else:
for message_uid in message_uid_list:
self.SQLDict_deleteMessage(message_uid=message_uid)
if not(isinstance(message_uid_list, list)):
message_uid_list = [message_uid_list]
self.SQLBase_delMessage(table=activity_dict[activity].sql_table,
uid=message_uid_list)
if REQUEST is not None:
return REQUEST.RESPONSE.redirect('%s/%s' % (
self.absolute_url(), 'view'))
......
<dtml-comment>
title:
connection_id:cmf_activity_sql_connection
max_rows:0
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>message_uid</params>
DELETE FROM
message
WHERE
uid=<dtml-sqlvar message_uid type="string">
<dtml-comment>
title:
connection_id:cmf_activity_sql_connection
max_rows:1
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>message_uid</params>
UPDATE
message
SET
processing_node=0,
processing=0
WHERE
uid=<dtml-sqlvar message_uid type="string">
<dtml-comment>
title:
connection_id:cmf_activity_sql_connection
max_rows:0
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>message_uid</params>
DELETE FROM
message_queue
WHERE
uid=<dtml-sqlvar message_uid type="string">
<dtml-comment>
title:
connection_id:cmf_activity_sql_connection
max_rows:1
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>message_uid</params>
UPDATE
message_queue
SET
processing_node=0,
processing=0
WHERE
uid=<dtml-sqlvar message_uid type="string">
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