Commit e2a9fb96 authored by Gabriel Monnerat's avatar Gabriel Monnerat

Use any() instead of create one script because the builtin function does the same thing

parent 63df908d
......@@ -20,11 +20,14 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Recipients email must be defined</string> </value>
<value> <string>Recipients email must be defined\n
\n
\n
python: object.getDestination() is not None and any(destination for destination in context.getDestinationValueList() if not destination.getDefaultEmailText())</string> </value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: object.getDestination() is not None and object.Event_checkIfDestinationEmailExist()</string> </value>
<value> <string>python: object.getDestination() is not None and any(destination for destination in context.getDestinationValueList() if not destination.getDefaultEmailText())</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>destination_list = context.getDestinationValueList()\n
for destination in destination_list:\n
if destination.getDefaultEmailText() in (None, \'\'):\n
return False\n
\n
return True\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Event_checkIfDestinationEmailExist</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
643
\ No newline at end of file
644
\ 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