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