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 @@ ...@@ -51,7 +51,9 @@
<item> <item>
<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
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> </string> </value>
</item> </item>
<item> <item>
......
...@@ -51,14 +51,13 @@ ...@@ -51,14 +51,13 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>portal = context.getPortalObject()\n
destination = context.getDefaultEventPathDestination()\n domain = context.getDefaultEventPathDestinationValue()\n
domain = portal.portal_domains.restrictedTraverse(destination)\n
event_path = context.getDefaultEventPathValue(portal_type="Event Path")\n event_path = context.getDefaultEventPathValue(portal_type="Event Path")\n
\n \n
method_kw = {\'event_path\': event_path.getRelativeUrl(),\n method_kw = {\'event_path\': event_path.getRelativeUrl(),\n
\'keep_draft\': keep_draft}\n \'keep_draft\': keep_draft}\n
portal.portal_catalog.searchAndActivate("Entity_createEventFromDefaultEventPath",\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 method_kw=method_kw)\n
\n \n
return context.Base_redirect(\n return context.Base_redirect(\n
......
...@@ -51,12 +51,11 @@ ...@@ -51,12 +51,11 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>portal = context.getPortalObject()\n
destination = context.getDefaultEventPathDestination()\n domain = context.getDefaultEventPathDestinationValue()\n
if destination is None:\n if domain is None:\n
return []\n return []\n
\n \n
domain = portal.portal_domains.restrictedTraverse(destination)\n return portal.portal_catalog(selection_domain={domain.getParentId(): (\'portal_domains\', domain.getRelativeUrl())})\n
return portal.portal_catalog(selection_domain={domain.getParentId(): (\'portal_domains\', destination)})\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
619 621
\ 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