Commit 02b04836 authored by Gabriel Monnerat's avatar Gabriel Monnerat

Refactor code to pass the event path instead of the Campaign

parent 45bab5a6
......@@ -52,10 +52,11 @@
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
\n
campaign = portal.portal_domains.restrictedTraverse(follow_up)\n
event_portal_type = campaign.getDefaultEventPathEventPortalType()\n
resource_reference = campaign.getDefaultEventPathResourceReference()\n
source = campaign.getDefaultEventPathSource()\n
event_path = portal.restrictedTraverse(event_path)\n
follow_up = event_path.getParentRelativeUrl()\n
event_portal_type = event_path.getEventPortalType()\n
resource_reference = event_path.getResourceReference()\n
source = event_path.getSource()\n
\n
language = context.getLanguage()\n
notification_message = portal.notification_message_module.NotificationTool_getDocumentValue(\n
......@@ -77,13 +78,15 @@ event = context.Base_addEvent(title=notification_message.getTitle(),\n
keep_draft=keep_draft,\n
batch_mode=True)\n
\n
event.edit(follow_up=follow_up,\n
source=source)\n
event.setFollowUp(follow_up)\n
\n
if event.getSource() is None:\n
event.setSource(source)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>follow_up, keep_draft</string> </value>
<value> <string>event_path, keep_draft</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -53,14 +53,16 @@
<value> <string>portal = context.getPortalObject()\n
destination = context.getDefaultEventPathDestination()\n
domain = portal.portal_domains.restrictedTraverse(destination)\n
event_path = context.getDefaultEventPathValue(portal_type="Event Path")\n
\n
method_kw = {\'follow_up\': context.getRelativeUrl(),\n
\'keep_draft\': keep_draft}\n
method_kw = {\'event_path\': event_path.getRelativeUrl(),\n
\'keep_draft\': keep_draft}\n
portal.portal_catalog.searchAndActivate("Entity_createEventFromDefaultEventPath",\n
selection_domain={domain.getParentId(): (\'portal_domains\', destination)},\n
method_kw=method_kw)\n
\n
context.Base_redirect(keep_items={\'portal_status_message\': context.Base_translateString(\'Events are being created in background\')})\n
return context.Base_redirect(\n
keep_items={\'portal_status_message\': context.Base_translateString(\'Events are being created in background\')})\n
</string> </value>
</item>
<item>
......
612
\ No newline at end of file
614
\ No newline at end of file
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