Commit 17cb437c authored by Georgios Dagkakis's avatar Georgios Dagkakis

erp5_core: Block Folder_delete for too large selections (>1000 documents)

as an extra safety measure
parent 7ea769a4
...@@ -13897,6 +13897,9 @@ msgstr "Effectuez une recherche pour afficher le contenu." ...@@ -13897,6 +13897,9 @@ msgstr "Effectuez une recherche pour afficher le contenu."
msgid "To reset your password, please enter your login below. An email will be sent to your address with a link to enter your new password." msgid "To reset your password, please enter your login below. An email will be sent to your address with a link to enter your new password."
msgstr "Afin de changer votre mot de passe, entrez votre nom d'utilisateur ci-dessous. Un email contenant des explications sur la marche à suivre sera envoyé à votre adresse." msgstr "Afin de changer votre mot de passe, entrez votre nom d'utilisateur ci-dessous. Un email contenant des explications sur la marche à suivre sera envoyé à votre adresse."
msgid "Too many documents selected."
msgstr "Trop de documents sélectionnés."
msgid "Too many documents were found." msgid "Too many documents were found."
msgstr "Trop de possibilités trouvées." msgstr "Trop de possibilités trouvées."
......
...@@ -35,6 +35,13 @@ if not listbox_uid: ...@@ -35,6 +35,13 @@ if not listbox_uid:
# already filters out documents with relations that cannot be deleted # already filters out documents with relations that cannot be deleted
object_list = context.Folder_getDeleteObjectList(uid=listbox_uid) object_list = context.Folder_getDeleteObjectList(uid=listbox_uid)
if len(object_list) > 1000:
return context.Base_redirect(
keep_items={
'portal_status_message': translate("Too many documents selected."),
'portal_status_level': "warning",
}
)
object_not_deletable_len = len(listbox_uid) - len(object_list) object_not_deletable_len = len(listbox_uid) - len(object_list)
# some documents cannot be deleted thus we stop and warn the user # some documents cannot be deleted thus we stop and warn the user
......
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