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 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>portal = state_change[\'object\'].getPortalObject()\n
tag = \'%s_reindex\' % state_change[\'object\'].getRelativeUrl()\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
<value> <string>document = state_change[\'object\']\n
alarm = document.getPortalObject().portal_alarms.accept_submitted_credentials\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>
</item>
<item>
......
437
\ No newline at end of file
438
\ 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