Commit 1105f030 authored by Gabriel Monnerat's avatar Gabriel Monnerat

Refactor code to get domain directly instead of restrictedTraverse and remove...

Refactor code to get domain directly instead of restrictedTraverse and remove base domain id hardcoded
parent 75b078f1
......@@ -51,7 +51,9 @@
<item>
<key> <string>_body</string> </key>
<value> <string>portal_catalog = context.getPortalObject().portal_catalog\n
return portal_catalog.countResults(selection_domain={\'campagin_domain\': (\'portal_domains\', context.getDefaultEventPathDestination())})\n
domain = context.getDefaultEventPathDestinationValue()\n
return portal_catalog.countResults(\n
selection_domain={domain.getParentId(): (\'portal_domains\', domain.getRelativeUrl(),)})\n
</string> </value>
</item>
<item>
......
......@@ -51,14 +51,13 @@
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
destination = context.getDefaultEventPathDestination()\n
domain = portal.portal_domains.restrictedTraverse(destination)\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\', destination)},\n
selection_domain={domain.getParentId(): (\'portal_domains\', domain.getRelativeUrl())},\n
method_kw=method_kw)\n
\n
return context.Base_redirect(\n
......
......@@ -51,12 +51,11 @@
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
destination = context.getDefaultEventPathDestination()\n
if destination is None:\n
domain = context.getDefaultEventPathDestinationValue()\n
if domain is None:\n
return []\n
\n
domain = portal.portal_domains.restrictedTraverse(destination)\n
return portal.portal_catalog(selection_domain={domain.getParentId(): (\'portal_domains\', destination)})\n
return portal.portal_catalog(selection_domain={domain.getParentId(): (\'portal_domains\', domain.getRelativeUrl())})\n
</string> </value>
</item>
<item>
......
619
\ No newline at end of file
621
\ 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