Commit a968df84 authored by Jérome Perrin's avatar Jérome Perrin

credential: rename alarm script to match convention and apply a limit to catalog searches

parent d0e364f4
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>active_sense_method_id</string> </key> <key> <string>active_sense_method_id</string> </key>
<value> <string>ERP5Site_acceptSubmittedCredentials</string> </value> <value> <string>Alarm_acceptSubmittedCredentialList</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
......
...@@ -50,12 +50,15 @@ ...@@ -50,12 +50,15 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>limit = context.getProperty(\'limit\', 100)\n
\n
portal = context.getPortalObject()\n
\n \n
if portal.portal_preferences.getPreferredCredentialRequestAutomaticApproval():\n if portal.portal_preferences.getPreferredCredentialRequestAutomaticApproval():\n
module = context.getDefaultModule(\'Credential Request\')\n module = context.getDefaultModule(\'Credential Request\')\n
result = module.searchFolder(portal_type=\'Credential Request\',\n result = module.searchFolder(portal_type=\'Credential Request\',\n
validation_state=\'submitted\')\n validation_state=\'submitted\',\n
limit=limit)\n
for document in result:\n for document in result:\n
if document.getValidationState() == \'submitted\':\n if document.getValidationState() == \'submitted\':\n
document.accept()\n document.accept()\n
...@@ -64,7 +67,8 @@ if portal.portal_preferences.getPreferredPersonCredentialUpdateAutomaticApproval ...@@ -64,7 +67,8 @@ if portal.portal_preferences.getPreferredPersonCredentialUpdateAutomaticApproval
portal.portal_preferences.getPreferredOrganisationCredentialUpdateAutomaticApproval():\n portal.portal_preferences.getPreferredOrganisationCredentialUpdateAutomaticApproval():\n
module = context.getDefaultModule(\'Credential Update\')\n module = context.getDefaultModule(\'Credential Update\')\n
result = module.searchFolder(portal_type=\'Credential Update\',\n result = module.searchFolder(portal_type=\'Credential Update\',\n
validation_state=\'submitted\')\n validation_state=\'submitted\',\n
limit=limit)\n
for document in result:\n for document in result:\n
if document.getValidationState() == \'submitted\':\n if document.getValidationState() == \'submitted\':\n
document.accept()\n document.accept()\n
...@@ -72,7 +76,8 @@ elif portal.portal_preferences.getPreferredPersonCredentialUpdateAutomaticApprov ...@@ -72,7 +76,8 @@ elif portal.portal_preferences.getPreferredPersonCredentialUpdateAutomaticApprov
not portal.portal_preferences.getPreferredOrganisationCredentialUpdateAutomaticApproval():\n not portal.portal_preferences.getPreferredOrganisationCredentialUpdateAutomaticApproval():\n
module = context.getDefaultModule(\'Credential Update\')\n module = context.getDefaultModule(\'Credential Update\')\n
result = module.searchFolder(portal_type=\'Credential Update\',\n result = module.searchFolder(portal_type=\'Credential Update\',\n
validation_state=\'submitted\')\n validation_state=\'submitted\',\n
limit=limit)\n
for document in result:\n for document in result:\n
if document.getDestinationDecisionValue().getPortalType() == \'Person\':\n if document.getDestinationDecisionValue().getPortalType() == \'Person\':\n
if document.getValidationState() == \'submitted\':\n if document.getValidationState() == \'submitted\':\n
...@@ -81,7 +86,8 @@ elif not portal.portal_preferences.getPreferredPersonCredentialUpdateAutomaticAp ...@@ -81,7 +86,8 @@ elif not portal.portal_preferences.getPreferredPersonCredentialUpdateAutomaticAp
portal.portal_preferences.getPreferredOrganisationCredentialUpdateAutomaticApproval():\n portal.portal_preferences.getPreferredOrganisationCredentialUpdateAutomaticApproval():\n
module = context.getDefaultModule(\'Credential Update\')\n module = context.getDefaultModule(\'Credential Update\')\n
result = module.searchFolder(portal_type=\'Credential Update\',\n result = module.searchFolder(portal_type=\'Credential Update\',\n
validation_state=\'submitted\')\n validation_state=\'submitted\',\n
limit=limit)\n
for document in result:\n for document in result:\n
if document.getDestinationDecisionValue().getPortalType() == \'Organisation\':\n if document.getDestinationDecisionValue().getPortalType() == \'Organisation\':\n
if document.getValidationState() == \'submitted\':\n if document.getValidationState() == \'submitted\':\n
...@@ -90,7 +96,8 @@ elif not portal.portal_preferences.getPreferredPersonCredentialUpdateAutomaticAp ...@@ -90,7 +96,8 @@ elif not portal.portal_preferences.getPreferredPersonCredentialUpdateAutomaticAp
if portal.portal_preferences.getPreferredCredentialRecoveryAutomaticApproval():\n if portal.portal_preferences.getPreferredCredentialRecoveryAutomaticApproval():\n
module = context.getDefaultModule(\'Credential Recovery\')\n module = context.getDefaultModule(\'Credential Recovery\')\n
result = module.searchFolder(portal_type=\'Credential Recovery\',\n result = module.searchFolder(portal_type=\'Credential Recovery\',\n
validation_state=\'submitted\')\n validation_state=\'submitted\',\n
limit=limit)\n
for document in result:\n for document in result:\n
if document.getValidationState() == \'submitted\':\n if document.getValidationState() == \'submitted\':\n
document.accept()\n document.accept()\n
...@@ -102,7 +109,7 @@ if portal.portal_preferences.getPreferredCredentialRecoveryAutomaticApproval():\ ...@@ -102,7 +109,7 @@ if portal.portal_preferences.getPreferredCredentialRecoveryAutomaticApproval():\
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ERP5Site_acceptSubmittedCredentials</string> </value> <value> <string>Alarm_acceptSubmittedCredentialList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
428 429
\ 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