Commit 01e4bf93 authored by Gabriel Monnerat's avatar Gabriel Monnerat

Fix the base_category field on Campaign_viewEventPath to set the relation...

Fix the base_category field on Campaign_viewEventPath to set the relation correctly and refactor Ticket_countDefaultEventPathDestinationList and Ticket_createEventFromDefaultEventPath to not display exception when the Domain is not set
parent 157edd54
......@@ -79,7 +79,7 @@
<dictionary>
<item>
<key> <string>base_category</string> </key>
<value> <string>destination</string> </value>
<value> <string>default_event_path_destination</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
......
......@@ -10,6 +10,7 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>base_category</string>
<string>editable</string>
</list>
</value>
......@@ -71,6 +72,10 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>base_category</string> </key>
<value> <string>default_event_path_source</string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
......
......@@ -52,6 +52,9 @@
<key> <string>_body</string> </key>
<value> <string>portal_catalog = context.getPortalObject().portal_catalog\n
domain = context.getDefaultEventPathDestinationValue()\n
if domain is None:\n
return [[0]]\n
\n
return portal_catalog.countResults(\n
selection_domain={domain.getParentId(): (\'portal_domains\', domain.getRelativeUrl(),)})\n
</string> </value>
......
......@@ -52,16 +52,19 @@
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
domain = context.getDefaultEventPathDestinationValue()\n
event_path = context.getDefaultEventPathValue(portal_type="Event Path")\n
\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\', domain.getRelativeUrl())},\n
method_kw=method_kw)\n
if domain is None:\n
message = \'Recipients must be defined\'\n
else:\n
event_path = context.getDefaultEventPathValue(portal_type="Event Path")\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\', domain.getRelativeUrl())},\n
method_kw=method_kw)\n
message = \'Events are being created in background\'\n
\n
return context.Base_redirect(\n
keep_items={\'portal_status_message\': context.Base_translateString(\'Events are being created in background\')})\n
return context.Base_redirect(keep_items={\'portal_status_message\': context.Base_translateString(message)})\n
</string> </value>
</item>
<item>
......
627
\ No newline at end of file
628
\ 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