Commit 2ef591e3 authored by Vincent Pelletier's avatar Vincent Pelletier

credential_interaction_workflow/scripts/Call_alarmActiveSense: Simplify.

Save one reindexation activity if alarm is not triggered.
Drop single-use locals.
Drop comment telling what the code already expresses.
parent 899234ad
...@@ -50,16 +50,12 @@ ...@@ -50,16 +50,12 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = state_change[\'object\'].getPortalObject()\n <value> <string>document = state_change[\'object\']\n
tag = \'%s_reindex\' % state_change[\'object\'].getRelativeUrl()\n alarm = document.getPortalObject().portal_alarms.accept_submitted_credentials\n
activate_kw = {\'tag\': tag} \n
state_change[\'object\'].reindexObject(activate_kw=activate_kw)\n
\n
# call alarm to speed up account creation process\n
# only if alarm is enabled\n
alarm = portal.portal_alarms.accept_submitted_credentials\n
if alarm.isEnabled():\n if alarm.isEnabled():\n
alarm.activate(activity=\'SQLDict\', after_tag=tag).activeSense()\n tag = document.getRelativeUrl() + \'_reindex\'\n
document.reindexObject(activate_kw={\'tag\': tag})\n
alarm.activate(activity=\'SQLQueue\', after_tag=tag).activeSense()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
437 438
\ 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