diff --git a/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud_promise/Alarm_checkPromiseSlapOSModuleIdGenerator.xml b/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud_promise/Alarm_checkPromiseSlapOSModuleIdGenerator.xml index ee8626e09ce339241b5eaae732db7a87f82c7503..1763cb28de24d5a2a9632bc4427d36cbd78d9119 100644 --- a/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud_promise/Alarm_checkPromiseSlapOSModuleIdGenerator.xml +++ b/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud_promise/Alarm_checkPromiseSlapOSModuleIdGenerator.xml @@ -56,10 +56,8 @@ portal = context.getPortalObject()\n wrong_module_list = []\n for module_id in portal.objectIds(spec=(\'ERP5 Folder\',)) + ["portal_simulation", "portal_activities"]:\n module = portal.restrictedTraverse(module_id)\n - if module.getIdGenerator() != \'_generatePerDayId\':\n + if not module.Module_assertIdGenerator(\'_generatePerDayId\', fixit):\n wrong_module_list.append(module.getRelativeUrl())\n - if fixit:\n - module.setIdGenerator(\'_generatePerDayId\')\n \n if len(wrong_module_list) != 0:\n summary = "Some modules have incorrect ID generator"\n diff --git a/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud_promise/Module_assertIdGenerator.xml b/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud_promise/Module_assertIdGenerator.xml new file mode 100644 index 0000000000000000000000000000000000000000..6ffd39b7ca38142d3cdaea361786eb566115a4fb --- /dev/null +++ b/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud_promise/Module_assertIdGenerator.xml @@ -0,0 +1,73 @@ +<?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>current_id_generator = context.getIdGenerator()\n +\n +if current_id_generator != id_generator:\n + if fixit:\n + context.setIdGenerator(id_generator)\n + return False\n +return True\n +</string> </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string>id_generator, fixit</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Module_assertIdGenerator</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/slapos_cloud/bt/revision b/master/bt5/slapos_cloud/bt/revision index 0947c3313659827e4a73ff591c1fdcbccf9ed12f..66321c084ca9a642e8b308c01850cfd0351b48d1 100644 --- a/master/bt5/slapos_cloud/bt/revision +++ b/master/bt5/slapos_cloud/bt/revision @@ -1 +1 @@ -188 \ No newline at end of file +189 \ No newline at end of file