Commit 99ddd946 authored by Julien Muchembled's avatar Julien Muchembled

CMFActivity: small refactoring

parent 8063c50a
......@@ -65,13 +65,7 @@ class SQLDict(SQLBase):
priority_list = [message.activity_kw.get('priority', 1) for message in registered_message_list]
dumped_message_list = [self.dumpMessage(message) for message in registered_message_list]
date_list = [message.activity_kw.get('at_date', None) for message in registered_message_list]
group_method_id_list = []
for m in registered_message_list:
group_method_id = m.activity_kw.get('group_method_id', '')
if group_method_id is None:
group_method_id = 'portal_activities/dummyGroupMethod/' + m.method_id
group_method_id_list.append(group_method_id + '\0' +
m.activity_kw.get('group_id', ''))
group_method_id_list = [m.getGroupId() for m in registered_message_list]
tag_list = [message.activity_kw.get('tag', '') for message in registered_message_list]
serialization_tag_list = [message.activity_kw.get('serialization_tag', '') for message in registered_message_list]
order_validation_text_list = [self.getOrderValidationText(message) for message in registered_message_list]
......
......@@ -66,13 +66,7 @@ class SQLQueue(SQLBase):
method_id_list = [m.method_id for m in registered_message_list]
priority_list = [m.activity_kw.get('priority', 1) for m in registered_message_list]
date_list = [m.activity_kw.get('at_date', None) for m in registered_message_list]
group_method_id_list = []
for m in registered_message_list:
group_method_id = m.activity_kw.get('group_method_id', '')
if group_method_id is None:
group_method_id = 'portal_activities/dummyGroupMethod/' + m.method_id
group_method_id_list.append(group_method_id + '\0' +
m.activity_kw.get('group_id', ''))
group_method_id_list = [m.getGroupId() for m in registered_message_list]
tag_list = [m.activity_kw.get('tag', '') for m in registered_message_list]
serialization_tag_list = [m.activity_kw.get('serialization_tag', '') for m in registered_message_list]
dumped_message_list = [self.dumpMessage(m) for m in registered_message_list]
......
......@@ -203,6 +203,13 @@ class Message(BaseMessage):
request.environ['HTTP_ACCEPT_LANGUAGE']
self.request_info['_script'] = list(request._script)
def getGroupId(self):
get = self.activity_kw.get
group_method_id = get('group_method_id', '')
if group_method_id is None:
group_method_id = 'portal_activities/dummyGroupMethod/' + self.method_id
return group_method_id + '\0' + get('group_id', '')
def getObject(self, activity_tool):
"""return the object referenced in this message."""
return activity_tool.unrestrictedTraverse(self.object_path)
......
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